3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function ReadXml($xmlstr) { $xml = new \SimpleXmlElement($xmlstr); var_dump($xml); } $xmlstr= '<Address><to>James</to><from>Jani</from><heading>Reminder</heading><body>Please check your mail.</body></Address>'; ReadXml($xmlstr);
Output for 5.3.0 - 7.1.0
object(SimpleXMLElement)#1 (4) { ["to"]=> string(5) "James" ["from"]=> string(4) "Jani" ["heading"]=> string(8) "Reminder" ["body"]=> string(23) "Please check your mail." }
Output for 5.0.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/ZUoB3 on line 5 object(SimpleXMLElement)#1 (4) { ["to"]=> string(5) "James" ["from"]=> string(4) "Jani" ["heading"]=> string(8) "Reminder" ["body"]=> string(23) "Please check your mail." }
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/ZUoB3 on line 5 Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/ZUoB3 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/ZUoB3 on line 5 Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/ZUoB3 on line 5