bug69169.phpt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. --TEST--
  2. Bug #69169 (simplexml_load_string parse wrongly when xml given in one row)
  3. --EXTENSIONS--
  4. simplexml
  5. --FILE--
  6. <?php
  7. $a = '<?xml version="1.0" encoding="UTF-8"?>
  8. <root a="b">
  9. <row b="y">
  10. <item s="t" />
  11. </row>
  12. <row p="c">
  13. <item y="n" />
  14. </row>
  15. </root>';
  16. $b = str_replace(array("\n", "\r", "\t"), "", $a);
  17. $simple_xml = simplexml_load_string($b);
  18. print_r($simple_xml);
  19. ?>
  20. --EXPECT--
  21. SimpleXMLElement Object
  22. (
  23. [@attributes] => Array
  24. (
  25. [a] => b
  26. )
  27. [row] => Array
  28. (
  29. [0] => SimpleXMLElement Object
  30. (
  31. [@attributes] => Array
  32. (
  33. [b] => y
  34. )
  35. [item] => SimpleXMLElement Object
  36. (
  37. [@attributes] => Array
  38. (
  39. [s] => t
  40. )
  41. )
  42. )
  43. [1] => SimpleXMLElement Object
  44. (
  45. [@attributes] => Array
  46. (
  47. [p] => c
  48. )
  49. [item] => SimpleXMLElement Object
  50. (
  51. [@attributes] => Array
  52. (
  53. [y] => n
  54. )
  55. )
  56. )
  57. )
  58. )