Re: Re: Syntactic improvement to array
| From: | Sara Golemon | Date: | Tue, 06 Feb 2007 00:21:08 +0000 |
| Subject: | Re: Re: Syntactic improvement to array | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27843@lists.php.net to get a copy of this message | ||
I would argue that list() (and [] when used like list()) should remain a terminal expression. Yes it's possible to make it non-terminal, but I don't like what the resulting syntax winds up looking like.
-Sara
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