1--TEST--
2Delayed freeing should not cause a UAF
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$xml = new DomDocument();
8$d = $xml->createElement("div");
9$d->appendChild($b = $xml->createElement("b"));
10$ret = $d->appendChild($xml->createElement("xxx"));
11echo $xml->saveXML($d), "\n";
12unset($d);
13
14echo $ret->textContent, "Done\n";
15?>
16--EXPECT--
17<div><b/><xxx/></div>
18Done
19