3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A extends SimpleXMLElement { } $xml = <<<XML <?xml version="1.0"?> <a> <b> <c> <value attr="Some Attr">Some Value</value> </c> </b> </a> XML; $a = new A($xml); if ($a->xpath('/a/b/c')) { echo 'Node is not empty'; } else { echo 'Node is empty'; }
Output for 5.0.0 - 7.1.0
Node is not empty
Output for 4.3.2 - 4.4.9
Fatal error: Class a: Cannot inherit from undefined class simplexmlelement in /in/TveNt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Class a: Cannot inherit from undefined class simplexmlelement in /in/TveNt on line 3