Category
stdlib · php-src-strict · ext/dom · pillar 4 · AOT
Problem
DOMAttr::isId() works on VM and JIT (true/false) but thin-AOT phpc build / bin/compile.php returns null after a successful compile. Root cause: domattr::isid is missing from DomInstanceMethodJit::USER_SCRIPT_DIRECT_METHODS, so user-script AOT ensureProxy('domattr::isid') no-ops and the call collapses to an ExternalMethod null stub. lib/JIT.php already remaps :object/isid to domattr::isid (#20129 follow-up), but registration never sticks under UserScriptAotEnv.
Probed 2026-08-10 on tip (a06ea91586) vs Zend 8.2 / VM+JIT PROFILE=8.4:
| Repro |
Zend |
VM |
JIT |
AOT |
setIdAttribute + getAttributeNode('id')->isId() |
true |
true |
true |
NULL |
createAttribute('id')->isId() |
false |
false |
false |
NULL |
method_exists(DOMAttr::class, 'isId') alone |
true |
true |
— |
LLVM verify ret i64 0 / i1 (orthogonal method_exists bool-box) |
php-src reference
PHP implementation target
lib/JIT/DomInstanceMethodJit.php — whitelist domattr::isid (+ dom\attr::isid) in USER_SCRIPT_DIRECT_METHODS + registerKnownProxies
- Existing bridge:
Call\DomInstanceMethod → VmDomInstanceInvoke / VmDomJitDispatch::attrIsId / VmDom::attrIsId (already wired for JIT)
Tried-first gates (this host)
| Gate |
Result |
Symptom |
| docker info |
green |
ok |
| bootstrap-inventory --check |
red (doc drift) |
non-DOM construct-flag drift (mbstring/date/JIT) |
helper-runtime --strict |
red |
60 stale ext/standard units (#29870, claimed lane-C) — DOM helpers fresh after #29846 |
| north-star5-fast / release-readiness |
deferred |
Pillar 1 owned elsewhere |
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
cat > /tmp/isid.php <<'\''PHP'\''
<?php
$d = new DOMDocument();
$e = $d->createElement("x");
$d->appendChild($e);
$e->setAttribute("id", "foo");
$e->setIdAttribute("id", true);
var_export($e->getAttributeNode("id")->isId());
echo "\n";
PHP
php /tmp/isid.php
PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/isid.php
PHP_COMPILER_PROFILE=8.4 php bin/compile.php -o /tmp/isid_aot /tmp/isid.php && /tmp/isid_aot
'
Done when
Refs #20129, #20140, #29257, #29853
Category
stdlib· php-src-strict · ext/dom · pillar 4 · AOTProblem
DOMAttr::isId()works on VM and JIT (true/false) but thin-AOTphpc build/bin/compile.phpreturnsnullafter a successful compile. Root cause:domattr::isidis missing fromDomInstanceMethodJit::USER_SCRIPT_DIRECT_METHODS, so user-script AOTensureProxy('domattr::isid')no-ops and the call collapses to an ExternalMethod null stub.lib/JIT.phpalready remaps:object/isidtodomattr::isid(#20129 follow-up), but registration never sticks underUserScriptAotEnv.Probed 2026-08-10 on tip (
a06ea91586) vs Zend 8.2 / VM+JIT PROFILE=8.4:setIdAttribute+getAttributeNode('id')->isId()truetruetrueNULLcreateAttribute('id')->isId()falsefalsefalseNULLmethod_exists(DOMAttr::class, 'isId')alonetruetrueret i64 0/i1(orthogonal method_exists bool-box)php-src reference
ext/dom/attr.c—dom_attr_is_idext/dom/php_dom.stub.php—DOMAttr::isId(): boolPHP implementation target
lib/JIT/DomInstanceMethodJit.php— whitelistdomattr::isid(+dom\attr::isid) inUSER_SCRIPT_DIRECT_METHODS+registerKnownProxiesCall\DomInstanceMethod→VmDomInstanceInvoke/VmDomJitDispatch::attrIsId/VmDom::attrIsId(already wired for JIT)Tried-first gates (this host)
--strictRepro
Done when
true/falsematching Zend/VM/JIT forisId()aftersetIdAttribute*/ plain Attrtest/repro/ortest/compliance/cases/dom/Refs #20129, #20140, #29257, #29853