Skip to content

Instantly share code, notes, and snippets.

@rafaelbernard
Created May 24, 2013 18:00
Show Gist options
  • Save rafaelbernard/5645340 to your computer and use it in GitHub Desktop.
Save rafaelbernard/5645340 to your computer and use it in GitHub Desktop.
<?php
function exception_error_handler($severity, $message, $filename, $lineno) {
if (error_reporting() == 0) {
return;
}
if (error_reporting() & $severity) {
throw new ErrorException($message, 0, $severity, $filename, $lineno);
}
}
set_error_handler("exception_error_handler");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment