Re: foreach() and list()
| From: | Andrei Zmievski | Date: | Sat, 16 Dec 2000 06:27:53 +0000 |
| Subject: | Re: foreach() and list() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-41568@lists.php.net to get a copy of this message | ||
At 03:58 AM 12/16/00 +0200, Zeev Suraski wrote:
What would that do? At 23:03 15/12/2000, Andrei Zmievski wrote: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; } -AndreiCan we support the following syntax? foreach ($array as list($val1, $val2, $val3)) {...} I think it could be useful in a number of situations.