3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <alfa> <one> <two> </alfa> <beta> <bhi> <bho> </beta> </root>"; $xml = simplexml_load_string( $xml); foreach( $xml->xpath( './/alfa') as $child) { echo $child->attributes(). "\n"; }

preferences:
34.79 ms | 402 KiB | 5 Q