--TEST-- Bug #79451 (Using DOMDocument->replaceChild on doctype causes double free) --EXTENSIONS-- dom --FILE-- loadHTML("
hello
"); $impl = new \DOMImplementation(); $dt = $impl->createDocumentType("html_replace", "", ""); $dom->replaceChild($dt, $dom->doctype); var_dump($dom->doctype->name); echo $dom->saveXML(); ?> --EXPECTF-- string(12) "html_replace"hello