Precastic Precastic - 6 months ago 65
PHP Question

Shorthand syntax for PHP arrays

Is this valid PHP syntax or just a shorthand for the documentation? Does anybody have the link to a help page describing this notation?

$array = [
[1, 2],
[3, 4],

If you have a look at the code examples in the Unpacking nested arrays with list() section on the
help page you will see this possibly new notation, however I can't seem to find any help for this.


The new syntax [] was added in PHP 5.4.0. Check out the documentation on arrays