Foreach list behaviour
| From: | Jared Williams | Date: | Sun, 02 Sep 2012 23:07:49 +0000 |
| Subject: | Foreach list behaviour | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-62697@lists.php.net to get a copy of this message | ||
Hi,
Just looking at the foreach list behaviour and it does this...
$i = [1, 2, 3];
foreach($i as list($a, $b))
var_dump($a, $b);
Outputs....
NULL
NULL
NULL
NULL
NULL
NULL
There is no test I can see covering this, so cannot tell if its
expected.
To me, $i does not meet the expected format, so should be some sort of
error happening.
Jared