3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $html = '<div class="h1">2008 Honda Accord Coupe<small> — Wuse II</small></div>'; $dom = new DomDocument(); $dom->loadHtml($html); $xpath = new DomXPath($dom); print $xpath->evaluate("string(//div[@class='h1']/text())");
Output for 5.1.0 - 7.2.6
2008 Honda Accord Coupe
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined method DOMXPath::evaluate() in /in/otuOK on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/otuOK on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/otuOK on line 4