3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "test"; $string = <<<XML <a> <b>success</b> </a> XML; $xml = new SimpleXMLElement($string); $result = $xml->xpath('/a/b'); foreach ($result as $r) { if (!empty($r)) { print_r((string)$r); } else { echo 'failure'; } }
Output for 5.0.0 - 5.3.29, 5.5.27 - 5.5.35, 5.6.11 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
testsuccess
Output for 5.4.0 - 5.5.26, 5.6.7 - 5.6.10, hhvm-3.10.0
testfailure
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.9
test Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/QaorF on line 9
Process exited with code 255.
Output for 4.4.2
test Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/QaorF on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
test Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/QaorF on line 9