|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-28 18:59 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
Description: ------------ When calling asXML() to a cloned element, the php segfaults. I've got no debug information, but the bug is easy to reproduce. I had this problem with PHP 5.2.0 and PHP 5.1.6. With PHP 5.1.2 everything is OK. The xml file is just an example - this happens with every xml file I tried! Reproduce code: --------------- alexiev-home:~/tests# cat SimpleXML.xml <?xml version="1.0" encoding="utf-8" ?> <test> </test> alexiev-home:~/tests# cat SimpleXML.php <?php $root = simplexml_load_file('SimpleXML.xml'); $clone = clone $root; var_dump($root); var_dump($clone); echo $clone->asXML(); // Segfault here ?> Expected result: ---------------- object(SimpleXMLElement)#1 (1) { [0]=> string(2) " " } object(SimpleXMLElement)#2 (1) { [0]=> string(2) " " } string(55) "<?xml version="1.0" encoding="utf-8"?> <test> </test> " Actual result: -------------- object(SimpleXMLElement)#1 (1) { [0]=> string(2) " " } object(SimpleXMLElement)#2 (1) { [0]=> string(2) " " } Segmentation fault