summaryrefslogtreecommitdiff
path: root/ext/dom/tests/bug66502.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/tests/bug66502.phpt')
-rw-r--r--ext/dom/tests/bug66502.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/dom/tests/bug66502.phpt b/ext/dom/tests/bug66502.phpt
new file mode 100644
index 0000000000..5b35b41e93
--- /dev/null
+++ b/ext/dom/tests/bug66502.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #66502 (DOM document dangling reference)
+--SKIPIF--
+<?php
+if (!extension_loaded('dom')) die('skip requires ext/dom');
+?>
+--FILE--
+<?php
+$dom = new DOMDocument('1.0', 'UTF-8');
+$element = $dom->appendChild(new DOMElement('root'));
+$comment = new DOMComment("Comment 0");
+$comment = $element->appendChild($comment);
+
+$comment->__construct("Comment 1");
+$comment->__construct("Comment 2");
+$comment->__construct("Comment 3");
+echo 'DONE', PHP_EOL;
+?>
+--EXPECT--
+DONE \ No newline at end of file