xref: /PHP-8.2/ext/simplexml/tests/001.phpt (revision 7f2f0c00)
1--TEST--
2SimpleXML: Simple document
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7
8var_dump(simplexml_load_file(__DIR__.'/sxe.xml'));
9
10?>
11--EXPECTF--
12object(SimpleXMLElement)#%d (2) {
13  ["@attributes"]=>
14  array(1) {
15    ["id"]=>
16    string(5) "elem1"
17  }
18  ["elem1"]=>
19  object(SimpleXMLElement)#%d (3) {
20    ["@attributes"]=>
21    array(1) {
22      ["attr1"]=>
23      string(5) "first"
24    }
25    ["comment"]=>
26    object(SimpleXMLElement)#%d (0) {
27    }
28    ["elem2"]=>
29    object(SimpleXMLElement)#%d (1) {
30      ["elem3"]=>
31      object(SimpleXMLElement)#%d (1) {
32        ["elem4"]=>
33        object(SimpleXMLElement)#%d (1) {
34          ["test"]=>
35          object(SimpleXMLElement)#%d (0) {
36          }
37        }
38      }
39    }
40  }
41}
42