Precastic Precastic - 1 year ago 123
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download