Search code examples
phpsublimetext2sublimetextsublimetext3sublime-text-plugin

Convert php arrays with the new syntax


I looking for a way (regex, snippet ,plugin etc) to convert the old arrays with the new php syntax with sublimeText.

// Old synthax
$var = array(
   'foo' => 'bar' 
);

// New synthax
$var = [
   'foo' => 'bar'
];

someone has an idea ?


Solution

  • I found a script that does the job perfectly !

    https://github.com/thomasbachem/php-short-array-syntax-converter