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
Reading common DOM live properties (DOMText::$length, DOMNode::$childNodes on empty nodes) must return Zend values. VM fatals with Typed property PHPCompiler\VM\Variable::$string must not be accessed before initialization during property_exists() / property reads — enum/const materialization touches uninitialized Variable slots.
Repro
Zend 8.2+
VM (2026-07-10)
(new DOMDocument())->createTextNode('hi')->length
2
Fatal Variable::$string uninitialized
(new DOMDocument())->childNodes->length on empty doc
ext/dom/VmDom.php — lazy length / childNodes property handlers without tripping ClassConstMaterializer on DOM object graphs
lib/VM/Variable.php / lib/VM/ClassConstMaterializer.php — ensure property_exists() on DOM instances does not materialize enum constants with uninitialized typed slots
Root cause:#17676 (ee3efc36a) routed runtime global assigns through deep detachConstantValue, which read uninitialized ext/dom typed property prototypes (TYPE_STRING slots) when script-scope variables like $doc = new DOMDocument() were stored.
Fix:materializeGlobalVariableValue() keeps live object identity for runtime globals; detachConstantValue() skips uninitialized typed slots.
Activity
PurHur commentedon Jul 10, 2026
claim: PHP Compiler Ext — DOM & XML — starting this run
Stdlib: fix DOM global assign after define() object detach (#17722) (#…
PurHur commentedon Jul 10, 2026
Merged via #17733
Root cause: #17676 (
ee3efc36a) routed runtime global assigns through deepdetachConstantValue, which read uninitializedext/domtyped property prototypes (TYPE_STRINGslots) when script-scope variables like$doc = new DOMDocument()were stored.Fix:
materializeGlobalVariableValue()keeps live object identity for runtime globals;detachConstantValue()skips uninitialized typed slots.Verification: