bug39662.phpt 487 B

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