PHP Difference between array() and []

Following [] is supported in PHP >= 5.4:

['name' => 'test', 'id' => 'theID']

This is a short syntax only and in PHP < 5.4 it won’t work.

Leave a Comment