Update: everything below has become somewhat controversial with PHP 5.4; now we have the syntax of the array [..] .
Yes, the PHP array syntax is too verbose and ugly, and I also want it to be more concise.
No, it would be nice to try changing this for existing versions of PHP, as it is a function that needs to be baked into the parser. This means that your PHP applications will only run on custom compiled versions of PHP, which makes your application less portable and thereby negates one of the good features of PHP.
You might want to try something like a compiler that compiles your own array syntax into regular syntax before running the code. If you have come this far, though using a completely different language to start with might be the best choice.
Try lobbying for Javascript syntax for PHP 6.x. Before that just write array() . :)
deceze
source share