Annotation of embedaddon/php/ext/simplexml/tests/bug39662.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #39662 (Segfault when calling asXML() of a cloned SimpleXMLElement)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("simplexml")) print "skip simplexml extension is not loaded"; ?>
! 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;
! 15: var_dump($root);
! 16: var_dump($clone);
! 17: var_dump($clone->asXML());
! 18:
! 19: echo "Done\n";
! 20: ?>
! 21: --EXPECTF--
! 22: object(SimpleXMLElement)#%d (1) {
! 23: [0]=>
! 24: string(2) "
! 25:
! 26: "
! 27: }
! 28: object(SimpleXMLElement)#%d (1) {
! 29: [0]=>
! 30: string(2) "
! 31:
! 32: "
! 33: }
! 34: string(15) "<test>
! 35:
! 36: </test>"
! 37: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>