Category
Language · php-src-strict / list destructure warning line
Problem
Keyed list / short-array destructure of a missing key correctly emits Undefined array key and assigns null, but the warning line is the previous statement, not the destructure. Positional [$a, $b] = [1] already cites the list line (parity OK).
Probed 2026-08-18 @ aa2e5e8b62 — Zend 8.2.32 vs php bin/vm.php / php bin/jit.php.
| Repro |
Zend 8.2.32 |
VM / JIT |
[$a, $b] = [1]; (file line 3) |
Warning key 1 line 3 |
line 3 (parity OK) |
['x' => $c] = ['y' => 1]; (file line 5) |
Warning key "x" line 5 |
Warning key "x" line 4 (the echo above) |
php-src reference
PHP implementation target
lib/Compiler.php — list/keyed-destructure fetch opcodes must keep the destructure source line (not the previous stmt)
lib/VM.php / lib/VM/ErrorReporter.php — undefinedArrayKey already has the right text; pass the list site
- JIT: same lineno on the fetch
- No new
runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_list_undef_key_line.php'
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_list_undef_key_line.php'
Done when
Category
Language· php-src-strict / list destructure warning lineProblem
Keyed list / short-array destructure of a missing key correctly emits
Undefined array keyand assignsnull, but the warning line is the previous statement, not the destructure. Positional[$a, $b] = [1]already cites the list line (parity OK).Probed 2026-08-18 @
aa2e5e8b62— Zend 8.2.32 vsphp bin/vm.php/php bin/jit.php.[$a, $b] = [1];(file line 3)1line 3['x' => $c] = ['y' => 1];(file line 5)"x"line 5"x"line 4 (theechoabove)php-src reference
Zend/zend_vm_def.h—ZEND_FETCH_LIST_RZend/zend_execute.c—zend_undefined_indexuses current oplinePHP implementation target
lib/Compiler.php— list/keyed-destructure fetch opcodes must keep the destructure source line (not the previous stmt)lib/VM.php/lib/VM/ErrorReporter.php—undefinedArrayKeyalready has the right text; pass the list siteruntime/*.cRepro
Done when
"x"cites line 5 of the repro (matches Zend); key1stays line 3.phptundertest/compliance/cases/language/