Kafin Kafin - 28 days ago 9
PHP Question

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 ?

Answer

I found a script that does the job perfectly !

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