3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = '<result total="26" start="0" count="10"/>'; $dom = new DOMDocument(); $dom->loadXml($xml); $xpath = new DOMXpath($dom); var_dump( $total = $xpath->evaluate('number(/*/@total)'), $start = $xpath->evaluate('number(/*/@start)'), $count = $xpath->evaluate('number(/*/@count)') );
Output for 5.1.0 - 7.1.0
float(26) float(0) float(10)
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined method DOMXPath::evaluate() in /in/Cmdun on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/Cmdun on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/Cmdun on line 5