--TEST-- GH-14702 (DOMDocument::xinclude() crash) --EXTENSIONS-- dom --FILE-- loadXML(<< XML); $xi = $doc->createElementNS('http://www.w3.org/2001/XInclude', 'xi:include'); $xi->setAttribute('href', 'nonexistent'); $fallback = $doc->createElementNS('http://www.w3.org/2001/XInclude', 'xi:fallback'); $xi->appendChild($fallback); $child1 = $fallback->appendChild($doc->createElement('fallback-child1')); $child2 = $fallback->appendChild($doc->createElement('fallback-child2')); $xpath = new DOMXPath($doc); $toReplace = $xpath->query('//child')->item(0); $toReplace->parentNode->replaceChild($xi, $toReplace); $keep = $doc->documentElement->lastElementChild; var_dump(@$doc->xinclude()); echo $doc->saveXML(); var_dump($keep->nodeName); $keep->textContent = 'still works'; echo $doc->saveXML(); ?> --EXPECT-- int(2) string(4) "keep" still works