3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = <<<XML <?xml version="1.0"?> <a> <b> <c> <value>Some Value</value> </c> </b> </a> XML; $a = new SimpleXMLElement($xml); foreach ($a->b->c->children() as $key => $value) { var_dump($value); }
Output for 5.0.0 - 5.3.29, 5.5.27 - 5.5.35, 5.6.11 - 5.6.28, 7.0.0 - 7.1.0
object(SimpleXMLElement)#2 (1) { [0]=> string(10) "Some Value" }
Output for hhvm-3.12.0
object(SimpleXMLElement)#8 (1) { [0]=> string(10) "Some Value" }
Output for hhvm-3.10.0
object(SimpleXMLElement)#8 (0) { }
Output for 5.4.0 - 5.5.26, 5.6.0 - 5.6.10
object(SimpleXMLElement)#2 (0) { }
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: simplexmlelement in <b>/in/SYWJW</b> on line <b>13</b><br />
Process exited with code 255.
Output for 4.4.2
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: simplexmlelement in <b>/in/SYWJW</b> on line <b>14</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: simplexmlelement in <b>/in/SYWJW</b> on line <b>13</b><br />