Re: [RFC] foreach_variable supporting T_LIST token
| From: | Hannes Magnusson | Date: | Wed, 06 Jul 2011 13:06:24 +0000 |
| Subject: | Re: [RFC] foreach_variable supporting T_LIST token | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53758@lists.php.net to get a copy of this message | ||
2011/7/6 Xinchen Hui <laruence@gmail.com>:
> Hi:
>
> T_LIST is not allowed to used with foreach before.
>
> and then there comes a freature request: #10203 allow
> foreach($array as list($a,$b)
Ironically enough you managed to miss the last closing ), enforcing
the point of this not being a natural syntax.
Furthermore, without reading the RFC, is this the same as
foreach($array as $a => $b) {}
or
foreach($array as $e) {
list($a, $b) = $e;
}
or.. ?
that really doesn't look like something PHP should support imo.
-Hannes