PHPStorm Regex Convert Array to Object Syntax

If you are converting some code from using array syntax to object property syntax then you might like this little snippet of regex.

This is design to paste straight into the find/replace dialogue in PHPStorm

Find:


\$(\w+)\['([^']+)'\]

Replace:


\\\$$1->$2

And that is it


Tags: findreplacephparrayobjectsyntaxregexphpstorm