Hi,

On Fri, 2008-01-11 at 12:40 +0300, Max Antonov wrote:
> I use PHP since version 5.0 release
> I'd like use this syntax
> $a = [ 2,6,9 ];
> $b = ['a'=>1 , 'v'=>'string'];
> foo(['bar'=>2, 'test'=null]);

The last line is exactly why I won't like such a syntax. Just consider
the a bit worse call like
   foo([1, $a[2]]);
I might even construct worse examples, but in the end you'll have to
take a quite close look to see what's going on, whereas the array()
syntax directly tells you "hey, here's an array", it are just 5 letters,
so typing it isn't too hard (especially when using an editor with
completion) ...

Yes, it's nice in short code, but I think it makes it way harder to read
other people's code - and that's already hard enough. (I, myself, would,
of course, ( ;-) ) use it "right" but I tend to read more code than I
write)

johannes

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to