Skip to content

Stdlib: DOMText::splitText() missing — text node split fatal (ext/dom/text.c) #17513

Description

@PurHur

Category

stdlib · php-src-strict

Problem

DOMText::splitText() is undefined on the VM, so splitting a text node at an offset fatals. Zend returns the tail fragment and shortens the original node.

Repro Zend 8.2+ VM (2026-07-09)
$text->splitText(2) on "hello" parent=he, tail=llo Error: Call to undefined method DOMText::splitText()

php-src reference

PHP implementation target

  • ext/dom/ VM DOM wrappers — wire splitText on DOMText via existing DOMCharacterData / node mutation paths in PHP (ext/dom/VmDom*.php); no new C runtime logic

Repro

./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_dom_split_text.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_dom_split_text.php'

Done when

  • DOMText::splitText(int $offset) returns tail DOMText and truncates parent per Zend
  • Compliance .phpt guard under test/compliance/cases/dom/
  • php-src-strict; no php-compiler-strict shortcut

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