> From: Richard Lynch > > How many newbies will be trying: > array[1, 2, 3]; > and left scratching their heads when it doesn't work?
Yes, even if I am in favor of the [] syntax, it is a good argument: 'array[ 1, 2, 3]' can become a very common error, and not especially among newbies! Maybe I am wrong, but would it be possible to accept all these syntaxes : array(1, 2, 3) (RHS only) [ 1, 2, 3 ] (RHS=array / LHS=list, I especially like: '$x = [ $a, $b ] = f()' :) list($a, $b) (LHS only) array[1, 2, 3] (RHS only) For this purpose, we could say that the [] notation is optionally preceded by 'array'. Another idea if you want to make it easier to understand for newbies: make array() and list() synonyms, so that array() behaves as list() when LHS, and list() behaves as array() when RHS. IMHO, it would become simpler to explain. If we implement both, we can even suppport 'list[ 1, 2, 3 ]'. How can we be more permissive? Regards Francois -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php