diff options
Diffstat (limited to 'Zend/tests/foreach_list_003.phpt')
-rw-r--r-- | Zend/tests/foreach_list_003.phpt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Zend/tests/foreach_list_003.phpt b/Zend/tests/foreach_list_003.phpt new file mode 100644 index 0000000000..8674ecd754 --- /dev/null +++ b/Zend/tests/foreach_list_003.phpt @@ -0,0 +1,13 @@ +--TEST-- +foreach with list key +--FILE-- +<?php + +$array = [['a', 'b'], 'c', 'd']; + +foreach($array as list($key) => list(list(), $a)) { +} + +?> +--EXPECTF-- +Fatal error: Cannot use list as key element in %sforeach_list_003.php on line %d |