3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = '<RESPONSE><FIELDS><FIELD KEY="MSG_VERSION">333</FIELD><FIELD KEY="CUST_NBR">222</FIELD><FIELD KEY="MERCH_NBR">111</FIELD></FIELDS></RESPONSE>'; $doc = new DOMDocument; $doc->loadXml($xml); $xpath = new DOMXPath($doc); $query = '/RESPONSE/FIELDS/FIELD'; $entries = $xpath->evaluate($query, $doc); foreach($entries as $item) { var_dump($item->getAttribute('KEY'); var_dump($item->textContent) }
Output for 5.3.0 - 5.6.13
Parse error: syntax error, unexpected ';' in /in/dshV2 on line 17
Process exited with code 255.