Category
Language · php-src-strict / AOT static property storage
Problem
Null-coalescing assignment to an uninitialized static property (C::$x ??= 7) must store and return the RHS like Zend. VM/JIT match Zend; AOT probe from the static-property differential hunt leaves the property unset and reads back NULL.
Probed 2026-08-18 @ 5243c6f5e5 — Zend 8.2.32 vs php bin/vm.php (VM green). AOT probe-reported from #31965 / docs/roadmap/AOT-CORRECTNESS-PLAN.md group 3 — not re-verified this run (single-file bin/compile.php exceeded 120s compile budget on a warm cache).
| Repro |
Zend 8.2.32 |
VM |
AOT (probe-reported) |
C::$x ??= 7; var_dump(C::$x); twice |
int(7) both times |
int(7) both times |
NULL (not stored) |
php-src reference
PHP implementation target
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_static_coalesce_assign.php'
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_static_coalesce_assign.php'
# AOT (slow — run on idle box):
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/static_ca test/repro/maintainer_gap_static_coalesce_assign.php && /tmp/static_ca'
Done when
Category
Language· php-src-strict / AOT static property storageProblem
Null-coalescing assignment to an uninitialized static property (
C::$x ??= 7) must store and return the RHS like Zend. VM/JIT match Zend; AOT probe from the static-property differential hunt leaves the property unset and reads backNULL.Probed 2026-08-18 @
5243c6f5e5— Zend 8.2.32 vsphp bin/vm.php(VM green). AOT probe-reported from #31965 /docs/roadmap/AOT-CORRECTNESS-PLAN.mdgroup 3 — not re-verified this run (single-filebin/compile.phpexceeded 120s compile budget on a warm cache).C::$x ??= 7; var_dump(C::$x);twiceint(7)both timesint(7)both timesNULL(not stored)php-src reference
Zend/zend_execute.c—ZEND_ASSIGN_OP/ZEND_COALESCEon static propertiesZend/zend_compile.c— static property fetch/write lvaluesPHP implementation target
lib/JIT.php/lib/AOT/— static property??=lowering must mark module init / persist store like ordinary static writes (AOT: static property assign from closure must use module globals (#31965) #31986 typed-static closure path)staticPropertyStore/ native-scalar static lvalue routing from AOT: static property assign from closure must use module globals (#31965) #31986 where applicableruntime/*.cRepro
Done when
??=on uninitialized static property stores value; repeated read returnsint(7)matching Zend@differential-repeatguard