3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0"?> <a> <b> <c> <value>Node Value</value> </c> </b> </a> XML; $a = new SimpleXMLElement($xml); $children = $a->b->c->children(); var_dump((bool)$children->value); var_dump($children->value) foreach ($a->b->c->children() as $child) { var_dump(isset($child)); var_dump($child); }
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in /in/pKBqe on line 18
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_FOREACH in /in/pKBqe on line 18
Process exited with code 255.

preferences:
173.71 ms | 1399 KiB | 58 Q