Re: Syntactic improvement to array

From: Date: Sun, 04 Feb 2007 14:23:31 +0000
Subject: Re: Syntactic improvement to array
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-27739@lists.php.net to get a copy of this message
Andi Gutmans wrote:
So what I'm thinking of is: array(1, 2, 3) == [1, 2, 3]
I like this syntax, more conscise but still clear (and well established in other languages by now). Two more thoughts (but please don't kill Andi's proposal because of it, rather dismiss my comments instead ;-)):
- [$a, $b, $c] = ...    equivalent to    list($a, $b, $c) = ...
- func('foo' => $foo, 'bar' => $bar, ...)   equivalent to func(array('foo' => $foo, 'bar' => $bar, ...), see http://cschneid.com/php/ for more info
Regards, - Chris

« previous php.internals (#27739) next »