3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = new SimpleXMLElement('gg'); json_encode($x);
based on ZWM9I
Output for 7.0.0 - 7.2.0
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /in/G2JUq on line 3 Warning: SimpleXMLElement::__construct(): gg in /in/G2JUq on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/G2JUq on line 3 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/G2JUq:3 Stack trace: #0 /in/G2JUq(3): SimpleXMLElement->__construct('gg') #1 {main} thrown in /in/G2JUq on line 3
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /in/G2JUq on line 3 Warning: SimpleXMLElement::__construct(): gg in /in/G2JUq on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/G2JUq on line 3 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/G2JUq:3 Stack trace: #0 /in/G2JUq(3): SimpleXMLElement->__construct('gg') #1 {main} thrown in /in/G2JUq on line 3
Process exited with code 255.