Skip to content

Stdlib: DOMNode::hasAttributes() — attribute probe parity (#14469)#14478

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-14469-dom-has-attributes
Jul 1, 2026
Merged

Stdlib: DOMNode::hasAttributes() — attribute probe parity (#14469)#14478
PurHur merged 1 commit into
masterfrom
agent/issue-14469-dom-has-attributes

Conversation

@PurHur

@PurHur PurHur commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement DOMNode::hasAttributes() in ext/dom/VmDom.php per php-src ext/dom/node.c (dom_node_has_attributes)
  • Register VM method on DOMNode; excludes xmlns / xmlns:prefix namespace declaration attributes
  • PHP-in-PHP only — no runtime/*.c growth

Closes #14469

php-src reference

  • ext/dom/node.cdom_node_has_attributes (element with properties != NULL)

Verification

php bin/vm.php test/repro/maintainer_gap_dom_element_has_attributes.php
# ok

php bin/vm.php -r '$d=new DOMDocument();$d->loadXML("<r a=\"1\"/>"); var_dump($d->documentElement->hasAttributes());'
# bool(true)

php bin/compile.php -l test/repro/maintainer_gap_dom_element_has_attributes.php
# exit 0

./vendor/bin/phpunit test/unit/DomModuleTest.php --filter has_attributes
# OK

Made with Cursor

Implement hasAttributes on DOMNode in ext/dom/VmDom.php per php-src
ext/dom/node.c; excludes xmlns namespace declaration attributes.

Co-authored-by: Cursor <cursoragent@cursor.com>
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: DOMElement::hasAttributes() missing — attribute probe fatal (ext/dom/node.c)

1 participant