Skip to content

Instantly share code, notes, and snippets.

@smk
Last active October 26, 2016 11:42
Show Gist options
  • Save smk/6318908 to your computer and use it in GitHub Desktop.
Save smk/6318908 to your computer and use it in GitHub Desktop.
Replacing PHP array setter "$var[foo] = bar;" with "foo => bar,".
Search:
^(\s*)\$\w+\[(['"][^'"]+['"])\]\s*=\s*(.+);$
Replace:
$1$2 => $3,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment