Skip to content

Stdlib: DOMNode::contains() missing — descendant check fatal (ext/dom/node.c, PHP 8+) #14447

Closed

Description

@PurHur

Summary

DOMNode::contains(?DOMNode $other): bool (DOM Living Standard) reports whether $other is a descendant of the receiver. VM fatals with undefined method DOMNode::contains(); Zend PHP 8+ implements it in ext/dom.

php-src reference

PHP implementation target

  • ext/dom/VmDom.php — walk childIds / parent chain in DomRegistry
  • Register on DOMNode / DOMElement in ext/dom/Module.php (PHP-in-PHP; no new C runtime)

Repro (php-src-strict)

./script/docker-exec.sh -- php bin/vm.php test/repro/maintainer_gap_dom_node_contains.php
Call Zend 8+ VM (wrong)
$root->contains($child) true undefined method

Done when

  • contains() registered on DOM node classes with php-src null-other semantics
  • test/repro/maintainer_gap_dom_node_contains.php green on VM
  • PHPUnit/compliance guard; VM/JIT/AOT agree when both in scope

Activity

  1. added
    enhancementNew feature or request
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 1, 2026
  2. PurHur commented on Jul 1, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — batch (issues #14420, #14447)

  3. PurHur commented on Jul 1, 2026

    @PurHur
    OwnerAuthor

    Merged in #14452 — VM repro test/repro/maintainer_gap_dom_node_contains.php green; DomModuleTest contains guard passes.

  4. PurHur commented on Jul 1, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — batch (issues #14447, #14410)

  5. PurHur commented on Jul 1, 2026

    @PurHur
    OwnerAuthor

    Merged via #14558. maintainer_gap_dom_node_contains.php prints ok on VM; AOT lint green; forward-profile phantom skips.

  6. PurHur commented on Jul 2, 2026

    @PurHur
    OwnerAuthor

    Forward-profile regression fixed in #15192: supportsDomNodeContains() now uses advertisesBuiltinSince('8.4.0') so 8.4.0-dev registers contains again. Verified: test/repro/maintainer_gap_dom_node_contains.php ok on VM.

  7. PurHur commented on Jul 7, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch ext/dom forward registration + htmlspecialchars_decode (#14447, #14448, #14449, #15195, #16824, #2454)

  8. PurHur commented on Jul 7, 2026

    @PurHur
    OwnerAuthor

    Merged in #17081 — DOM Living Standard APIs now register on 8.4.0-dev via builtinAdvertisementVersion(); htmlspecialchars_decode ENT_COMPAT expect aligned with php-src. Verified: CompilerVersionGateTest (Dom), VMTest dom_node_* + htmlspecialchars_decode_flags, DomDocumentVMTest, maintainer_gap dom repros.

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 machineenhancementNew feature or requestimplementation-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