3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = <<<XML XML; $xml = new SimpleXMLElement($string); if (!$xml) { echo "fail"; } else { echo "good"; }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Exception: String could not be parsed as XML in /in/DiO6S:5 Stack trace: #0 /in/DiO6S(5): SimpleXMLElement->__construct('') #1 {main} thrown in /in/DiO6S on line 5
Process exited with code 255.
Output for 5.0.3 - 5.1.1, 5.1.3 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/DiO6S:5 Stack trace: #0 /in/DiO6S(5): SimpleXMLElement->__construct('') #1 {main} thrown in /in/DiO6S on line 5
Process exited with code 255.
Output for 5.1.2
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/DiO6S:6 Stack trace: #0 /in/DiO6S(6): SimpleXMLElement->__construct('') #1 {main} thrown in /in/DiO6S on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/DiO6S:5 Stack trace: #0 {main} thrown in /in/DiO6S on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/DiO6S on line 5
Process exited with code 255.
Output for 4.4.2
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/DiO6S on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/DiO6S on line 5