--TEST-- Delayed freeing entity reference --EXTENSIONS-- dom --FILE-- appendChild($doc->createElementNS('some:ns', 'container')) ->appendChild($doc->createEntityReference('nbsp')); echo $doc->saveXML(), "\n"; $entityRef->parentNode->remove(); echo $doc->saveXML(), "\n"; var_dump($entityRef->parentNode); var_dump($entityRef->nodeName); var_dump($entityRef->textContent); $doc = new DOMDocument; $doc->loadXML(<<<'XML' ]>
XML); $entityRef = $doc->documentElement->appendChild($doc->createEntityReference('test')); echo $doc->saveXML(), "\n"; $entityRef->parentNode->remove(); unset($doc); var_dump($entityRef->nodeName); var_dump($entityRef->textContent); ?> --EXPECT--   NULL string(4) "nbsp" string(0) "" ]>
&test;
string(4) "test" string(0) ""