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