3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<XML <a> <foo name="one" game="lonely">1</foo> <foo name="two" game="wow">2</foo> </a> XML; $xml = simplexml_load_string($string); var_dump($xml->foo[1]);exit; $xml = simplexml_load_string($string); foreach($xml->foo->attributes() as $a => $b) { echo $a,'="',$b,"\"\n"; } ?>

preferences:
54.84 ms | 402 KiB | 5 Q