Skip to content

Instantly share code, notes, and snippets.

@Swader
Created December 7, 2012 11:25
Show Gist options
  • Save Swader/4232662 to your computer and use it in GitHub Desktop.
Save Swader/4232662 to your computer and use it in GitHub Desktop.
notices_article_04
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