3v4l.org

run code in 200+ php & hhvm versions
<?php $xml=simplexml_load_string(<<<XML <root> <item> <price>88</price> <newprice>88</newprice> </item> <item> <price>88</price> <newprice>45</newprice> </item> <item> <price>88</price> <newprice>145</newprice> </item> </root> XML ); foreach($xml->xpath('//newprice[number(text())<number(../price/text())]') as $node) { print_r((string)$node); }