Run Rector on your code to see what it can do for you:
<?php -echo $foo{bar}; +echo $foo[bar];
Applied Rules:
Not a change you expect?
rector.php