1--TEST--
2Delayed freeing dtd node
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$doc = new DOMDocument;
8$dtd = $doc->implementation->createDocumentType('qualified name', 'public', 'system');
9$doc = $doc->implementation->createDocument('', '', $dtd);
10echo $doc->saveXML(), "\n";
11unset($doc);
12echo $dtd->ownerDocument->saveXML();
13$dtd->ownerDocument->removeChild($dtd);
14var_dump($dtd->ownerDocument->nodeName);
15?>
16--EXPECT--
17<?xml version="1.0"?>
18<!DOCTYPE qualified name PUBLIC "public" "system">
19
20<?xml version="1.0"?>
21<!DOCTYPE qualified name PUBLIC "public" "system">
22string(9) "#document"
23