summaryrefslogtreecommitdiff
path: root/Zend/tests/foreach_list_002.phpt
blob: 1c693651fdc4b343d8fb157bd03cf91421744bed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
foreach with freak lists
--FILE--
<?php

foreach (array(array(1,2), array(3,4)) as list($a, )) {
    var_dump($a);
}

$array = [['a', 'b'], 'c', 'd'];

foreach($array as list(, $a)) {
   var_dump($a);
}

?>
--EXPECT--
int(1)
int(3)
string(1) "b"
NULL
NULL