3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<'XML' <foo bar="baz" tab="taz"> <bar> </foo> XML; $xml = new SimpleXmlElement($xml); var_dump($xml->getName()); var_dump($xml->attributes()); var_dump($xml->children());
Output for git.master, git.master_jit, rfc.property-hooks
Warning: SimpleXMLElement::__construct(): Entity: line 3: parser error : Opening and ending tag mismatch: bar line 2 and foo in /in/9sXna on line 9 Warning: SimpleXMLElement::__construct(): </foo> in /in/9sXna on line 9 Warning: SimpleXMLElement::__construct(): ^ in /in/9sXna on line 9 Warning: SimpleXMLElement::__construct(): Entity: line 3: parser error : Premature end of data in tag foo line 1 in /in/9sXna on line 9 Warning: SimpleXMLElement::__construct(): </foo> in /in/9sXna on line 9 Warning: SimpleXMLElement::__construct(): ^ in /in/9sXna on line 9 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/9sXna:9 Stack trace: #0 /in/9sXna(9): SimpleXMLElement->__construct('<foo bar="baz" ...') #1 {main} thrown in /in/9sXna on line 9
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

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


preferences:
59.9 ms | 402 KiB | 8 Q