3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "<<<XML <?xml version='1.0'?> <document> <cmd>login</cmd> <login>Richard</login> </document> XML"; $xml = simplexml_load_string($string); print_r($xml); $login = $xml->login; print_r($login); $login = (string) $xml->login; print_r($login); ?>
based on qZ3lT
Output for 7.2.0
Warning: simplexml_load_string(): Entity: line 1: parser error : StartTag: invalid element name in /in/jV2if on line 11 Warning: simplexml_load_string(): <<<XML in /in/jV2if on line 11 Warning: simplexml_load_string(): ^ in /in/jV2if on line 11 Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/jV2if on line 11 Warning: simplexml_load_string(): <<<XML in /in/jV2if on line 11 Warning: simplexml_load_string(): ^ in /in/jV2if on line 11 Notice: Trying to get property 'login' of non-object in /in/jV2if on line 13 Notice: Trying to get property 'login' of non-object in /in/jV2if on line 15
Output for 5.1.0 - 7.1.10
Warning: simplexml_load_string(): Entity: line 1: parser error : StartTag: invalid element name in /in/jV2if on line 11 Warning: simplexml_load_string(): <<<XML in /in/jV2if on line 11 Warning: simplexml_load_string(): ^ in /in/jV2if on line 11 Warning: simplexml_load_string(): Entity: line 1: parser error : Extra content at the end of the document in /in/jV2if on line 11 Warning: simplexml_load_string(): <<<XML in /in/jV2if on line 11 Warning: simplexml_load_string(): ^ in /in/jV2if on line 11 Notice: Trying to get property of non-object in /in/jV2if on line 13 Notice: Trying to get property of non-object in /in/jV2if on line 15
Output for 5.0.0 - 5.0.5
Warning: Entity: line 1: parser error : StartTag: invalid element name in /in/jV2if on line 11 Warning: <<<XML in /in/jV2if on line 11 Warning: ^ in /in/jV2if on line 11 Warning: Entity: line 1: parser error : Extra content at the end of the document in /in/jV2if on line 11 Warning: <<<XML in /in/jV2if on line 11 Warning: ^ in /in/jV2if on line 11 Notice: Trying to get property of non-object in /in/jV2if on line 13 Notice: Trying to get property of non-object in /in/jV2if on line 15
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/jV2if on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/jV2if on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/jV2if on line 11