Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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