3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = "<root> <parent> <child name='Child1'><a href="aaaa">AAA</a></child> <child name='Child2'>BBBB</child> <subparent> <child name='Child3'>CCCC</child> </subparent> </parent> <child name='Child4'>DDDD</child> </root>"; $xml = simplexml_load_string( $xml); foreach( $xml->xpath( './/child[position() = 2]') as $child) { echo $child. "\n"; }
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'aaaa' (T_STRING) in /in/p4Zp7 on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/p4Zp7 on line 4
Process exited with code 255.