3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = new SimpleXMLElement("<root attr='2'><test2>tests</test2><test2 attr='4'>test34</test2></root>"); var_dump(get_object_vars($xml));
Output for 5.1.2 - 7.1.0
array(2) { ["@attributes"]=> array(1) { ["attr"]=> string(1) "2" } ["test2"]=> array(2) { [0]=> string(5) "tests" [1]=> string(6) "test34" } }
Output for 5.0.0 - 5.1.1
array(1) { ["test2"]=> array(2) { [0]=> string(5) "tests" [1]=> string(6) "test34" } }
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/S4dJ7 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/S4dJ7 on line 3