3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $file = "index.php"; $line = 20; $type = "PHP_ERROR"; $friendly_errors["PHP_ERROR"] = "PHP Error"; $my_message = "Testo"; $format_backtrace = ""; $error_data = "<error>".PHP_EOL; $error_data .= "\t<dateline>".time()."</dateline>".PHP_EOL; $error_data .= "\t<script>".$file."</script>".PHP_EOL; $error_data .= "\t<line>".$line."</line>".PHP_EOL; $error_data .= "\t<type>".$type."</type>".PHP_EOL; $error_data .= "\t<friendly_type>".$friendly_errors[$type]."</friendly_type>".PHP_EOL; $error_data .= "\t<message>".$my_message."</message>".PHP_EOL; $error_data .= "\t<backtrace>".$format_backtrace."</backtrace>".PHP_EOL; $error_data .= "</error>".PHP_EOL; $doc = new DOMDocument(); $doc->loadXML($error_data); $errors = $doc->getElementsByTagName("error"); $dateline = $errors->getElementsByTagName("dateline"); $file = $errors->getElementsByTagName("script"); $line = $errors->getElementsByTagName("line"); $type = $errors->getElementsByTagName("type"); var_dump($dateline, $file, $line, $type);
based on PI6YP
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined method DOMNodeList::getElementsByTagName() in /in/A6V7A:23 Stack trace: #0 {main} thrown in /in/A6V7A on line 23
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined method DOMNodeList::getElementsByTagName() in /in/A6V7A on line 23
Process exited with code 255.