--TEST--
GH-16039 (Segmentation fault (access null pointer) in ext/dom/parentnode/tree.c)
--EXTENSIONS--
dom
--FILE--
appendChild($dom->createElement('root'));
try {
$element->prepend('x', new DOMEntity);
} catch (DOMException $e) {
echo $e->getMessage(), "\n";
}
echo $dom->saveXML();
$dom->strictErrorChecking = false; // Should not have influence
try {
$element->prepend('x', new DOMEntity);
} catch (DOMException $e) {
echo $e->getMessage(), "\n";
}
echo $dom->saveXML();
?>
--EXPECT--
Invalid State Error
Invalid State Error