Created
March 18, 2012 23:06
-
-
Save shaneharter/2084244 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function shutdown_function() | |
{ | |
$error = error_get_last(); | |
if (is_array($error) && isset($error['type']) == false) | |
return; | |
switch($error['type']) | |
{ | |
case E_ERROR: | |
case E_PARSE: | |
case E_CORE_ERROR: | |
case E_CORE_WARNING: | |
case E_COMPILE_ERROR: | |
$e = sprintf('%s %s %s:%s', $error['type'], $error['message'], $error['file'], $error['line']); | |
error_log($e); | |
} | |
} | |
register_shutdown_function('shutdown_function'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment