3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str=<<<XML <root> <A> <someid>5</someid> </A> <B> <someid>15</someid> </B> </root> XML; $xml=simplexml_load_string($str); foreach($xml->xpath('//someid[text()="5"]') as $node) { echo $node; }

preferences:
11.48 ms | 457 KiB | 5 Q