Skip to content

Instantly share code, notes, and snippets.

@wimleers
Created November 25, 2010 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wimleers/716034 to your computer and use it in GitHub Desktop.
Save wimleers/716034 to your computer and use it in GitHub Desktop.
Set this error handler before erroneous code and you'll get a nice report of the exact error, including a brief stack trace. Simple & nice. Who knew. Stupid PHP.
function handler($errno, $errstr, $errfile, $errline) {
throw new Exception($errstr, $errno);
}
set_error_handler('handler');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment