Good question. If it's possible to make it behave this way, I don't see why not. On the other hand, if you take list(), it can't be used in RHS.

-Andrei

On Feb 5, 2007, at 10:28 AM, Todd Ruth wrote:

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

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

Reply via email to