You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stdlib: DOMElement::compareDocumentPosition() undefined — sibling order bit checks missing (ext/dom/node.c) #17696
stdlib · php-src-strict · DOM Level 3 node ordering
Problem
Zend exposes DOMElement::compareDocumentPosition() for document-order bitmask checks (DOMNode::DOCUMENT_POSITION_*). This compiler fatals with Call to undefined method DOMElement::compareDocumentPosition() on the same snippet.
Verified 2026-07-10 on master (reference profile).
Root cause:compareDocumentPosition was incorrectly gated behind supportsDomApiSince('8.4.0') even though it is DOM Level 3 (php-src ext/dom/node.c), available on Zend 8.0+ reference profile.
Fix:supportsDomNodeCompareDocumentPosition() now returns true; removed SKIPIF/phantom guards for this method.
Verification:
source script/php-env.sh
php bin/vm.php test/repro/maintainer_gap_dom_compare_document_position_sibling.php # ok
php bin/jit.php test/repro/maintainer_gap_dom_compare_document_position_sibling.php # ok
php vendor/bin/phpunit test/unit/DomModuleTest.php --filter test_dom_node_compare_document_position --no-configuration # OK
Activity
PurHur commentedon Jul 10, 2026
claim: PHP Compiler Ext — DOM & XML — starting this run
Stdlib: advertise DOMNode::compareDocumentPosition() on reference pro…
PurHur commentedon Jul 10, 2026
Merged via #17779.
Root cause:
compareDocumentPositionwas incorrectly gated behindsupportsDomApiSince('8.4.0')even though it is DOM Level 3 (php-srcext/dom/node.c), available on Zend 8.0+ reference profile.Fix:
supportsDomNodeCompareDocumentPosition()now returnstrue; removed SKIPIF/phantom guards for this method.Verification: