3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = '"<?xml version=\"1.0\" encoding=\"UTF-8\"?><checkOrderResponse performedDatetime=\"2017-07-09T16:11:52+03:00\" code=\"0\" invoiceId=\"2000729266842\" shopId=\"45951\"\/>"'; $data = new SimpleXMLElement(stripslashes($x)); echo '<pre>'.$data->asXML().'</pre>';
Output for 7.0.0 - 7.2.9
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /in/NOZaD on line 3 Warning: SimpleXMLElement::__construct(): "<?xml version="1.0" encoding="UTF-8"?><checkOrderResponse performedDatetime="20 in /in/NOZaD on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/NOZaD on line 3 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/NOZaD:3 Stack trace: #0 /in/NOZaD(3): SimpleXMLElement->__construct('"<?xml version=...') #1 {main} thrown in /in/NOZaD on line 3
Process exited with code 255.
Output for hhvm-3.18.4, hhvm-3.22.0
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/NOZaD:-1 Stack trace: #0 /in/NOZaD(-1): SimpleXMLElement->__construct() #1 {main} Entity: line 1: parser error : Start tag expected, '<' not found "<?xml version="1.0" encoding="UTF-8"?><checkOrderResponse performedDatetime="20 ^
Process exited with code 255.
Output for hhvm-3.15.4, hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/NOZaD:3 Stack trace: #0 /in/NOZaD(3): SimpleXMLElement->__construct() #1 {main} Entity: line 1: parser error : Start tag expected, '<' not found "<?xml version="1.0" encoding="UTF-8"?><checkOrderResponse performedDatetime="20 ^
Process exited with code 255.
Output for 5.6.30
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /in/NOZaD on line 3 Warning: SimpleXMLElement::__construct(): "<?xml version="1.0" encoding="UTF-8"?><checkOrderResponse performedDatetime="20 in /in/NOZaD on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/NOZaD on line 3 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/NOZaD:3 Stack trace: #0 /in/NOZaD(3): SimpleXMLElement->__construct('"<?xml version=...') #1 {main} thrown in /in/NOZaD on line 3
Process exited with code 255.