Date: 12/16/00
- Next message: Zeev Suraski: "Re: [PHP-DEV] foreach() and list()"
- Previous message: Andi Gutmans: "Re: [PHP-DEV] New Function: is_scalar"
- Next in thread: Zeev Suraski: "Re: [PHP-DEV] foreach() and list()"
- Reply: Zeev Suraski: "Re: [PHP-DEV] foreach() and list()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 03:58 AM 12/16/00 +0200, Zeev Suraski wrote:
>What would that do?
>
>At 23:03 15/12/2000, Andrei Zmievski wrote:
>>Can we support the following syntax?
>>
>>foreach ($array as list($val1, $val2, $val3)) {
>> ...
>>}
>>
>>I think it could be useful in a number of situations.
If $array has nested arrays, it would assign the values of those to the
list() variables, equivalent to:
foreach ($array as $inner_array) {
list($val1, $val2, $val3) = $inner_array;
}
-Andrei
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Zeev Suraski: "Re: [PHP-DEV] foreach() and list()"
- Previous message: Andi Gutmans: "Re: [PHP-DEV] New Function: is_scalar"
- Next in thread: Zeev Suraski: "Re: [PHP-DEV] foreach() and list()"
- Reply: Zeev Suraski: "Re: [PHP-DEV] foreach() and list()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

