Skip to content

Stdlib: DOMXPath query/evaluate VM surface (#6066)#17525

Merged
PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-dom-xpath-6066
Jul 9, 2026
Merged

Stdlib: DOMXPath query/evaluate VM surface (#6066)#17525
PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-dom-xpath-6066

Conversation

@PurHur

@PurHur PurHur commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Register DOMXPath class with __construct, query(), evaluate(), and registerNamespace() in ext/dom/ (php-src ext/dom/xpath.c)
  • PHP-in-PHP XPath evaluator in VmDomXPath.php — descendant //tag, attribute predicates [@id="2"], absolute /path, child axis, count()/string()/boolean() helpers
  • No new C runtime logic

php-src reference

  • ext/dom/xpath.cdom_xpath_query, dom_xpath_evaluate, dom_xpath_register_ns

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro-maintainer/parity_domxpath.php'
# ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter dom_xpath_query'
# OK (3 tests)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter DomModuleTest::test_dom_xpath_query_attribute_predicate'
# OK (1 test)

Closes #6066

Made with Cursor

Register DOMXPath with PHP-in-PHP xpath evaluation for descendant
queries and attribute predicates; wire constructor, query, evaluate,
and registerNamespace per php-src ext/dom/xpath.c.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 7057f6e into master Jul 9, 2026
@PurHur PurHur deleted the agent/advanced-stdlib-dom-xpath-6066 branch July 9, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: DOMXPath — XPath queries on DOMDocument missing (ext/dom/xpath.c)

1 participant