You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
define() accepts an object value, but materialized properties are empty on read. Zend stores and returns dynamic property values on the constant object; this compiler loses them (property reads yield empty values / wrong json_encode / empty get_object_vars).
Root cause:define('MY_OBJ', (object)[...]) stored shallow/shared object handles; dead temp slot cleanup double-released constant objects after property reads.
Fix: Deep EnumCaseSupport::materializeConstantValue() + ClassConstMaterializer::detachConstantValue() for object constants; prescan skips inner array for (object)[...]; temp release no longer double-drops refcount on constant objects (userConstantReferencesObjectId guard).
Activity
PurHur commentedon Jul 10, 2026
claim: PHP Compiler STD Lib — starting this run
PurHur commentedon Jul 10, 2026
claim: PHP Compiler STD Lib — starting this run
PurHur commentedon Jul 10, 2026
claim: PHP Compiler STD Lib Advanced — batch (issues #17676, #17693, #17680)
Stdlib: define object constants, readonly introspection, ldap phantom…
PurHur commentedon Jul 10, 2026
Merged via #17703.
Verification (VM):
PurHur commentedon Jul 10, 2026
Focused VM fix pushed in PR #17704 (materialize detached object constants, prescan skip for
(object)[...]define values, cast detach, temp-release refcount fix).Verification (VM):
```bash
php bin/vm.php test/repro/maintainer_gap_define_object_constant.php # ok
php bin/vm.php test/compliance/cases/stdlib/define_object_constant.phpt # ok
phpunit --filter define_object_constant # OK (2 tests)
```
AOT compile for this repro remains a follow-up (JIT runtime user-constant fetch + array-literal IR). Overlaps batch PR #17703 — prefer one merge path for #17676.
Merge origin/master into define() object constant fix (#17676).
Fix define() object constants preserving dynamic property values (#17676
PurHur commentedon Jul 10, 2026
Merged via #17704.
Verification:
Root cause:
define('MY_OBJ', (object)[...])stored shallow/shared object handles; dead temp slot cleanup double-released constant objects after property reads.Fix: Deep
EnumCaseSupport::materializeConstantValue()+ClassConstMaterializer::detachConstantValue()for object constants; prescan skips inner array for(object)[...]; temp release no longer double-drops refcount on constant objects (userConstantReferencesObjectIdguard).php-src:
ext/standard/basic_functions.c,Zend/zend_constants.cStdlib: fix DOM global assign after define() object detach (#17722) (#…
Fix define() array element assign-by-ref write-context fatal (#26488) (…