Skip to content

Instantly share code, notes, and snippets.

@tom--
Created September 7, 2013 17:06
Show Gist options
  • Save tom--/6477293 to your computer and use it in GitHub Desktop.
Save tom--/6477293 to your computer and use it in GitHub Desktop.
serialize and unserialize PHP expressions in vim
vmap <leader>s <esc>:'<,'> !php -r 'echo serialize(eval("return " . file_get_contents("php://stdin") . ";"));'<CR>
vmap <leader>u <esc>:'<,'> !php -r 'var_export(unserialize(file_get_contents("php://stdin")));'<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment