xref: /php-src/ext/simplexml/tests/bug39662.phpt (revision 7f2f0c00)
1--TEST--
2Bug #39662 (Segfault when calling asXML() of a cloned SimpleXMLElement)
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7
8$xml = '<?xml version="1.0" encoding="utf-8" ?>
9<test>
10
11</test>';
12
13$root = simplexml_load_string($xml);
14$clone = clone $root;
15var_dump($root);
16var_dump($clone);
17var_dump($clone->asXML());
18
19echo "Done\n";
20?>
21--EXPECTF--
22object(SimpleXMLElement)#%d (0) {
23}
24object(SimpleXMLElement)#%d (0) {
25}
26string(%d) "<?xml version="1.0" encoding="utf-8"?>
27<test>
28
29</test>
30"
31Done
32