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
>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php