Skip to content

Instantly share code, notes, and snippets.

@shaneharter
Created March 18, 2012 23:06
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 shaneharter/2084244 to your computer and use it in GitHub Desktop.
Save shaneharter/2084244 to your computer and use it in GitHub Desktop.
<?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