Skip to content

Regression: AOT user-script DOMXPath::evaluate() rejects or/and expressions — compile abort in dom_xpath_or_and fixture (ext/dom/xpath.c) #32123

Description

@PurHur

Category

Regression: · php-src-strict · ext/dom AOT user-script bridge

Problem

DOMXPath or/and parity was fixed for VM/JIT in #32050, but AOT user-script compile still aborts for the same expressions. In this workspace, targeted AOT tests fail because DOMXPath::evaluate() rejects or/and as unsupported and exits before running the fixture.

Probed 2026-08-18 via docker wrapper.

Repro Zend 8.2+ AOT (2026-08-18)
evaluate('true() or false()') in dom_xpath_or_and.phpt true compile abort: unsupported expression class
evaluate('1 or 0') true compile abort
count(//a[@id or @class]) 2.0 compile abort before runtime

php-src reference

PHP implementation target

  • ext/dom/JitDomXPathEvaluateUserScript.php — extend user-script AOT bridge to accept/compile or/and expression shapes already supported by VM/JIT path
  • ext/dom/JitDomXPathExpr.php (if needed) — share boolean-expression acceptance logic; no new runtime/*.c

Repro

./script/phpunit.sh --filter 'DomXpathOrAndAotTest|AotTest::testCases.*dom_xpath_or_and'
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./phpc build -o /tmp/dom_or_and test/repro/maintainer_gap_dom_xpath_or_and.php && /tmp/dom_or_and'

Done when

  • dom_xpath_or_and AOT fixture compiles and matches Zend outputs (or=2, and=1, not_id=2, boolean evaluates)
  • Targeted AOT + VM/JIT guards pass (DomXpathOrAndAotTest and existing VM/JIT tests)
  • php-src-strict; no php-compiler-strict shortcut

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 workingphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions