xref: /PHP-8.3/ext/dom/tests/bug66502.phpt (revision bd9f4fa6)
1--TEST--
2Bug #66502 (DOM document dangling reference)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$dom = new DOMDocument('1.0', 'UTF-8');
8$element = $dom->appendChild(new DOMElement('root'));
9$comment = new DOMComment("Comment 0");
10$comment = $element->appendChild($comment);
11
12$comment->__construct("Comment 1");
13$comment->__construct("Comment 2");
14$comment->__construct("Comment 3");
15echo 'DONE', PHP_EOL;
16?>
17--EXPECT--
18DONE
19