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 foreach 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With