xref: /PHP-8.2/Zend/tests/foreach_list_003.phpt (revision 5ebbdecf)
1--TEST--
2foreach with list key
3--FILE--
4<?php
5
6$array = [['a', 'b'], 'c', 'd'];
7
8foreach($array as list($key) => list(list(), $a)) {
9}
10
11?>
12--EXPECTF--
13Fatal error: Cannot use list as key element in %sforeach_list_003.php on line %d
14