Skip to content

Regression: AOT DOMAttr::isId() returns null — Zend/VM/JIT bool (re-#20129, ext/dom/attr.c) #29884

Description

@PurHur

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\DomInstanceMethodVmDomInstanceInvoke / 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

  • AOT binary prints true / false matching Zend/VM/JIT for isId() after setIdAttribute* / plain Attr
  • Smallest compliance/repro guard under test/repro/ or test/compliance/cases/dom/
  • php-src-strict; no restamp; no php-compiler-strict shortcut

Refs #20129, #20140, #29257, #29853

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:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions