bug46047.phpt 826 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --TEST--
  2. Bug #46047 (SimpleXML converts empty nodes into object with nested array)
  3. --EXTENSIONS--
  4. simplexml
  5. --FILE--
  6. <?php
  7. $xml = new SimpleXMLElement('<foo><bar><![CDATA[]]></bar><baz/></foo>',
  8. LIBXML_NOCDATA);
  9. print_r($xml);
  10. $xml = new SimpleXMLElement('<foo><bar></bar><baz/></foo>');
  11. print_r($xml);
  12. $xml = new SimpleXMLElement('<foo><bar/><baz/></foo>');
  13. print_r($xml);
  14. ?>
  15. --EXPECT--
  16. SimpleXMLElement Object
  17. (
  18. [bar] => SimpleXMLElement Object
  19. (
  20. )
  21. [baz] => SimpleXMLElement Object
  22. (
  23. )
  24. )
  25. SimpleXMLElement Object
  26. (
  27. [bar] => SimpleXMLElement Object
  28. (
  29. )
  30. [baz] => SimpleXMLElement Object
  31. (
  32. )
  33. )
  34. SimpleXMLElement Object
  35. (
  36. [bar] => SimpleXMLElement Object
  37. (
  38. )
  39. [baz] => SimpleXMLElement Object
  40. (
  41. )
  42. )