xref: /PHP-8.1/ext/simplexml/tests/bug69169.phpt (revision 7f2f0c00)
1--TEST--
2Bug #69169 (simplexml_load_string parse wrongly when xml given in one row)
3--EXTENSIONS--
4simplexml
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);
18print_r($simple_xml);
19?>
20--EXPECT--
21SimpleXMLElement Object
22(
23    [@attributes] => Array
24        (
25            [a] => b
26        )
27
28    [row] => Array
29        (
30            [0] => SimpleXMLElement Object
31                (
32                    [@attributes] => Array
33                        (
34                            [b] => y
35                        )
36
37                    [item] => SimpleXMLElement Object
38                        (
39                            [@attributes] => Array
40                                (
41                                    [s] => t
42                                )
43
44                        )
45
46                )
47
48            [1] => SimpleXMLElement Object
49                (
50                    [@attributes] => Array
51                        (
52                            [p] => c
53                        )
54
55                    [item] => SimpleXMLElement Object
56                        (
57                            [@attributes] => Array
58                                (
59                                    [y] => n
60                                )
61
62                        )
63
64                )
65
66        )
67
68)
69