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