Skip to content

AOT: static property ??= not stored — readback NULL (re-#31965, zend_static_variable) #32035

Description

@PurHur

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

  • AOT: ??= on uninitialized static property stores value; repeated read returns int(7) matching Zend
  • VM/JIT unchanged green
  • Compliance or AOT PHPT with @differential-repeat guard
  • php-src-strict; no php-compiler-strict shortcut
  • Reproduce on current master before closing (probe-reported until then)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions