Re: Re: Syntactic improvement to array

From: Date: Mon, 05 Feb 2007 18:28:49 +0000
Subject: Re: Re: Syntactic improvement to array
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-27819@lists.php.net to get a copy of this message
Would this be legal? function f() { return [ 1, 2 ]; } $x = [ $a, $b ] = f(); In the end, would we have...? $a = 1; $b = 2; $x = array(1,2); I'm not trying to be positive or negative about the syntax. I'm just "testing" somewhat edge cases. - Todd On Mon, 2007-02-05 at 10:06 -0800, Andrei Zmievski wrote: ... > The way I view [] is that it creates an array "context". When the > context is an RHS, it instantiates an array. When it's an LHS, the > context deconstructs the array. > > -Andrei >

« previous php.internals (#27819) next »