bug67116.phpt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. --TEST--
  2. Bug #67116 (Inconsistent parsing of Nodes w/o linefeed)
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded("simplexml")) die("skip SimpleXML not available");
  6. ?>
  7. --FILE--
  8. <?php
  9. $xml = <<<XML
  10. <?xml version="1.0" encoding="UTF-8"?>
  11. <aa>
  12. <bs>
  13. <b>b</b>
  14. </bs>
  15. <cs><c>b</c></cs>
  16. <ds><d id="d"></d></ds>
  17. <es>
  18. <e id="e"></e>
  19. </es>
  20. <fs><f id="f"></f><f id="f"></f></fs>
  21. </aa>
  22. XML;
  23. $sxe = simplexml_load_string($xml);
  24. print_r($sxe);
  25. ?>
  26. --EXPECT--
  27. SimpleXMLElement Object
  28. (
  29. [bs] => SimpleXMLElement Object
  30. (
  31. [b] => b
  32. )
  33. [cs] => SimpleXMLElement Object
  34. (
  35. [c] => b
  36. )
  37. [ds] => SimpleXMLElement Object
  38. (
  39. [d] => SimpleXMLElement Object
  40. (
  41. [@attributes] => Array
  42. (
  43. [id] => d
  44. )
  45. )
  46. )
  47. [es] => SimpleXMLElement Object
  48. (
  49. [e] => SimpleXMLElement Object
  50. (
  51. [@attributes] => Array
  52. (
  53. [id] => e
  54. )
  55. )
  56. )
  57. [fs] => SimpleXMLElement Object
  58. (
  59. [f] => Array
  60. (
  61. [0] => SimpleXMLElement Object
  62. (
  63. [@attributes] => Array
  64. (
  65. [id] => f
  66. )
  67. )
  68. [1] => SimpleXMLElement Object
  69. (
  70. [@attributes] => Array
  71. (
  72. [id] => f
  73. )
  74. )
  75. )
  76. )
  77. )