Hi,
On 07/06/2011 03:06 PM, Hannes Magnusson wrote:
> 2011/7/6 Xinchen Hui <[email protected]>:
>>
>> 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) {}
No, there $a would be the key. Intention would be, as I read the RFC,
that this could be an arbitrary list.
> or
> foreach($array as $e) {
> list($a, $b) = $e;
> }
Yes, I understood if like that. Just a short notation.
> or.. ?
>
> that really doesn't look like something PHP should support imo.
Don't see too many bad things about the idea ...
Regards,
Stefan
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php