3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = '<user><prop name="A"><sub name="X"></sub></prop><prop name="B"><sub name="Y"></sub></prop></user>'; $xml = new DomDocument; $xml->loadXML($data); $xpath = new DomXpath($xml); var_dump( $xpath->query('//sub[@name="Y"]');
Output for 5.3.0 - 5.4.20
Parse error: syntax error, unexpected ';' in /in/KLY3E on line 9
Process exited with code 255.