--TEST--
Segfault when removing the Doctype node
--SKIPIF--
--FILE--
footext'>
bartext'>
]>
&foo;&bar;
XML;
$doc = new DOMDocument();
$doc->loadXML($xml, LIBXML_NOENT);
$n = $doc->doctype;
$doc->removeChild($n);
echo get_class($n), "\n";
print $doc->saveXML();
?>
===DONE===
--EXPECTF--
DOMDocumentType
footextbartext
===DONE===