xref: /PHP-5.6/Zend/tests/foreach_list_002.phpt (revision 5ebbdecf)
1--TEST--
2foreach with freak lists
3--FILE--
4<?php
5
6foreach (array(array(1,2), array(3,4)) as list($a, )) {
7    var_dump($a);
8}
9
10$array = [['a', 'b'], 'c', 'd'];
11
12foreach($array as list(list(), $a)) {
13   var_dump($a);
14}
15
16?>
17--EXPECTF--
18int(1)
19int(3)
20string(1) "b"
21
22Notice: Uninitialized string offset: 1 in %sforeach_list_002.php on line %d
23string(0) ""
24
25Notice: Uninitialized string offset: 1 in %sforeach_list_002.php on line %d
26string(0) ""
27