xref: /PHP-8.2/ext/dom/tests/bug66783.phpt (revision ac18dd0d)
1--TEST--
2Bug #66783 (UAF when appending DOMDocument to element)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$doc = new DomDocument;
8$doc->loadXML('<root></root>');
9$e = $doc->createElement('e');
10try {
11    $e->appendChild($doc);
12} catch (DOMException $ex) {
13    echo $ex->getMessage(), PHP_EOL;
14}
15?>
16--EXPECT--
17Hierarchy Request Error
18