3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $el = new SimpleXMLElement('65'); var_dump((string) $el); var_dump($el->asXml());

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /in/cmkdJ on line 2 Warning: SimpleXMLElement::__construct(): 65 in /in/cmkdJ on line 2 Warning: SimpleXMLElement::__construct(): ^ in /in/cmkdJ on line 2 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/cmkdJ:2 Stack trace: #0 /in/cmkdJ(2): SimpleXMLElement->__construct('65') #1 {main} thrown in /in/cmkdJ on line 2
Output for Array change keys
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /in/cmkdJ on line 2 Warning: SimpleXMLElement::__construct(): 65 in /in/cmkdJ on line 2 Warning: SimpleXMLElement::__construct(): ^ in /in/cmkdJ on line 2 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/cmkdJ:2 Stack trace: #0 /in/cmkdJ(2): SimpleXMLElement->__construct('65') #1 {main} thrown in /in/cmkdJ on line 2
Output for Lexical anon
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /in/cmkdJ on line 2 Warning: SimpleXMLElement::__construct(): 65 in /in/cmkdJ on line 2 Warning: SimpleXMLElement::__construct(): ^ in /in/cmkdJ on line 2 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/cmkdJ:2 Stack trace: #0 /in/cmkdJ(2): SimpleXMLElement->__construct('65') #1 {main} thrown in /in/cmkdJ on line 2

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page