3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = new \SimpleXMLElement('<resource href="/"><x><0>test</0></x></resource>'); echo $xml->x;
Output for 7.0.0 - 7.1.0
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : StartTag: invalid element name in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : expected '>' in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Opening and ending tag mismatch: x line 1 and unparseable in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Opening and ending tag mismatch: resource line 1 and x in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Extra content at the end of the document in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/ojguo:3 Stack trace: #0 /in/ojguo(3): SimpleXMLElement->__construct('<resource href=...') #1 {main} thrown in /in/ojguo on line 3
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/ojguo:3 Stack trace: #0 /in/ojguo(3): SimpleXMLElement->__construct() #1 {main} Entity: line 1: parser error : StartTag: invalid element name <resource href="/"><x><0>test</0></x></resource> ^ Entity: line 1: parser error : expected '>' <resource href="/"><x><0>test</0></x></resource> ^ Entity: line 1: parser error : Opening and ending tag mismatch: x line 1 and unparseable <resource href="/"><x><0>test</0></x></resource> ^ Entity: line 1: parser error : Opening and ending tag mismatch: resource line 1 and x <resource href="/"><x><0>test</0></x></resource> ^ Entity: line 1: parser error : Extra content at the end of the document <resource href="/"><x><0>test</0></x></resource> ^
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.7 - 5.6.28
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : StartTag: invalid element name in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : expected '>' in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Opening and ending tag mismatch: x line 1 and unparseable in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Opening and ending tag mismatch: resource line 1 and x in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Extra content at the end of the document in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): <resource href="/"><x><0>test</0></x></resource> in /in/ojguo on line 3 Warning: SimpleXMLElement::__construct(): ^ in /in/ojguo on line 3 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/ojguo:3 Stack trace: #0 /in/ojguo(3): SimpleXMLElement->__construct('<resource href=...') #1 {main} thrown in /in/ojguo on line 3
Process exited with code 255.