Category
stdlib · php-src-strict
Problem
DOMDocument::createDocumentFragment() and the DOMDocumentFragment class are missing (class_exists('DOMDocumentFragment') → false). Even after baseline #3326 (DOMDocument/DOMElement), workers need fragment nodes to batch-append subtrees without polluting the live document — standard in php-src ext/dom and required for config/HTML builders.
Depends on #3326 (DOMDocument baseline).
php-src reference
Repro (failure today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(class_exists(\"DOMDocumentFragment\")); echo PHP_EOL;"
php -r "var_export(class_exists(\"DOMDocumentFragment\")); echo PHP_EOL;"
'
| Check |
Zend (dom ext) |
VM |
class_exists('DOMDocumentFragment') |
true |
false |
After #3326 lands, minimal behavior repro:
<?php
$doc = new DOMDocument();
$frag = $doc->createDocumentFragment();
$child = $doc->createElement('item');
$frag->appendChild($child);
$doc->documentElement->appendChild($frag);
echo $doc->saveXML();
Scope (PHP-in-PHP first)
| Layer |
Path |
| Classes |
ext/dom/BuiltinClasses.php — register DOMDocumentFragment |
| VM |
ext/dom/VmDom.php — fragment node type, appendChild delegation |
| Methods |
ext/dom/DocumentCreateDocumentFragment.php |
| Tests |
test/compliance/cases/stdlib/dom_document_fragment.phpt |
Not in scope: full DOM Level 3 Load/Save (#3326 umbrella).
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter dom_document_fragment'
Related
Category
stdlib· php-src-strictProblem
DOMDocument::createDocumentFragment()and theDOMDocumentFragmentclass are missing (class_exists('DOMDocumentFragment')→ false). Even after baseline #3326 (DOMDocument/DOMElement), workers need fragment nodes to batch-append subtrees without polluting the live document — standard in php-srcext/domand required for config/HTML builders.Depends on #3326 (DOMDocument baseline).
php-src reference
ext/dom/php_dom.c—dom_document_create_document_fragment,domdocumentfragment_class_entryext/dom/document.c—createDocumentFragmentmethod tableRepro (failure today)
class_exists('DOMDocumentFragment')truefalseAfter #3326 lands, minimal behavior repro:
Scope (PHP-in-PHP first)
ext/dom/BuiltinClasses.php— registerDOMDocumentFragmentext/dom/VmDom.php— fragment node type,appendChilddelegationext/dom/DocumentCreateDocumentFragment.phptest/compliance/cases/stdlib/dom_document_fragment.phptNot in scope: full DOM Level 3 Load/Save (#3326 umbrella).
Done when
class_exists('DOMDocumentFragment')true on VMcreateDocumentFragment()returns appendable fragment; subtree merges into document without extra wrapper elementappendChildon fragment moves children per php-src (not alias bugs)./script/ci-fast.sh --filter dom_document_fragmentgreenVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter dom_document_fragment'Related