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