3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(!class_exists('SimpleXMLElement')) die("Bonkers"); $xml = new SimpleXMLElement('<xml><node></node>'); var_dump(typeof($xml->node)); var_dump(typeof($xml->node->foo)); var_dump(isset($xml->node->foo)); var_dump(is_null($xml->node->foo));
Output for 7.0.6 - 7.1.0
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Premature end of data in tag xml line 1 in /in/fm3NT on line 3 Warning: SimpleXMLElement::__construct(): <xml><node></node> in /in/fm3NT on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/fm3NT on line 3 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/fm3NT:3 Stack trace: #0 /in/fm3NT(3): SimpleXMLElement->__construct('<xml><node></no...') #1 {main} thrown in /in/fm3NT on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.5
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Premature end of data in tag xml line 1 in /in/fm3NT on line 3 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/fm3NT:3 Stack trace: #0 /in/fm3NT(3): SimpleXMLElement->__construct('<xml><node></no...') #1 {main} thrown in /in/fm3NT on line 3
Process exited with code 255.
Output for 5.1.0 - 5.5.28, 5.5.35 - 5.6.12, 5.6.21 - 5.6.28
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Premature end of data in tag xml line 1 in /in/fm3NT on line 3 Warning: SimpleXMLElement::__construct(): <xml><node></node> in /in/fm3NT on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/fm3NT on line 3 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/fm3NT:3 Stack trace: #0 /in/fm3NT(3): SimpleXMLElement->__construct('<xml><node></no...') #1 {main} thrown in /in/fm3NT on line 3
Process exited with code 255.
Output for 5.5.29 - 5.5.34, 5.6.13 - 5.6.20
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Premature end of data in tag xml line 1 in /in/fm3NT on line 3 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/fm3NT:3 Stack trace: #0 /in/fm3NT(3): SimpleXMLElement->__construct('<xml><node></no...') #1 {main} thrown in /in/fm3NT on line 3
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Warning: Entity: line 1: parser error : Premature end of data in tag xml line 1 in /in/fm3NT on line 3 Warning: <xml><node></node> in /in/fm3NT on line 3 Warning: ^ in /in/fm3NT on line 3 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/fm3NT:3 Stack trace: #0 /in/fm3NT(3): SimpleXMLElement->__construct('<xml><node></no...') #1 {main} thrown in /in/fm3NT on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Warning: Entity: line 1: parser error : Premature end of data in tag xml line 1 in /in/fm3NT on line 3 Warning: <xml><node></node> in /in/fm3NT on line 3 Warning: ^ in /in/fm3NT on line 3 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/fm3NT:3 Stack trace: #0 {main} thrown in /in/fm3NT on line 3
Process exited with code 255.
Output for 4.3.0 - 4.4.9
Bonkers