3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = "<root> <parent> <child name='Child1' /> <child name='Child2' /> <subparent> <child name='Child3' /> </subparent> </parent> <child name='Child4' /> </root>"; $xml = simplexml_load_string( $xml); foreach( $xml->query( '/child' as $child)) { echo $child->attributes()['name'] . "\n"; }
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected 'as' (T_AS) in /in/kUpQd on line 15
Process exited with code 255.
Output for 5.2.15 - 5.3.27
Parse error: syntax error, unexpected T_AS in /in/kUpQd on line 15
Process exited with code 255.