Skip to content

Instantly share code, notes, and snippets.

@victorknust
Forked from Swader/notices_article_04.php
Created March 26, 2014 15:33
Show Gist options
  • Save victorknust/9786117 to your computer and use it in GitHub Desktop.
Save victorknust/9786117 to your computer and use it in GitHub Desktop.
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting
return;
}
echo "<b>ERROR!</b> [$errno] $errstr<br />\n";
echo " Fatal error on line $errline in file $errfile";
echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
echo "Aborting...<br />\n";
exit(1);
break;
}
$old_error_handler = set_error_handler("myErrorHandler");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment