3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = <<<XML <?xml version="1.0"?> <root> <value></value> </root> XML; $xml = simplexml_load_string($s); $xml->value = 'HOSTING\foo_bar'; echo $xml->asXml();
based on ZLgk0
Output for 7.0.0 - 7.1.0
Warning: simplexml_load_string(): Entity: line 2: parser error : XML declaration allowed only at the start of the document in /in/kWrg6 on line 11 Warning: simplexml_load_string(): <?xml version="1.0"?> in /in/kWrg6 on line 11 Warning: simplexml_load_string(): ^ in /in/kWrg6 on line 11 Warning: Creating default object from empty value in /in/kWrg6 on line 12 Fatal error: Uncaught Error: Call to undefined method stdClass::asXml() in /in/kWrg6:13 Stack trace: #0 {main} thrown in /in/kWrg6 on line 13
Process exited with code 255.
Output for hhvm-3.12.0
Warning: Creating default object from empty value in /in/kWrg6 on line 12 Fatal error: Call to undefined method stdClass::asXml() in /in/kWrg6 on line 13 Entity: line 2: parser error : XML declaration allowed only at the start of the document <?xml version="1.0"?> ^
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.6.28
Warning: simplexml_load_string(): Entity: line 2: parser error : XML declaration allowed only at the start of the document in /in/kWrg6 on line 11 Warning: simplexml_load_string(): <?xml version="1.0"?> in /in/kWrg6 on line 11 Warning: simplexml_load_string(): ^ in /in/kWrg6 on line 11 Warning: Creating default object from empty value in /in/kWrg6 on line 12 Fatal error: Call to undefined method stdClass::asXml() in /in/kWrg6 on line 13
Process exited with code 255.
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.3.29
Warning: simplexml_load_string(): Entity: line 2: parser error : XML declaration allowed only at the start of the document in /in/kWrg6 on line 11 Warning: simplexml_load_string(): <?xml version="1.0"?> in /in/kWrg6 on line 11 Warning: simplexml_load_string(): ^ in /in/kWrg6 on line 11 Strict Standards: Creating default object from empty value in /in/kWrg6 on line 12 Fatal error: Call to undefined method stdClass::asXml() in /in/kWrg6 on line 13
Process exited with code 255.
Output for 5.1.2
Warning: simplexml_load_string(): Entity: line 2: parser error : XML declaration allowed only at the start of the document in /in/kWrg6 on line 12 Warning: simplexml_load_string(): <?xml version="1.0"?> in /in/kWrg6 on line 12 Warning: simplexml_load_string(): ^ in /in/kWrg6 on line 12 Strict Standards: Creating default object from empty value in /in/kWrg6 on line 13 Fatal error: Call to undefined method stdClass::asXml() in /in/kWrg6 on line 14
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: Entity: line 2: parser error : XML declaration allowed only at the start of the document in /in/kWrg6 on line 11 Warning: <?xml version="1.0"?> in /in/kWrg6 on line 11 Warning: ^ in /in/kWrg6 on line 11 Strict Standards: Creating default object from empty value in /in/kWrg6 on line 12 Fatal error: Call to undefined method stdClass::asXml() in /in/kWrg6 on line 13
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/kWrg6 on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/kWrg6 on line 11
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/kWrg6 on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/kWrg6 on line 11