I can use set_error_handler()
to catch most PHP errors, but it doesn\'t work for fatal (E_ERROR
) errors, such as calling a function that doesn\'t e
Well, it seems possible to catch fatal errors some other way :)
ob_start('fatal_error_handler');
function fatal_error_handler($buffer){
$error = error_get_last();
if($error['type'] == 1){
// Type, message, file, line
$newBuffer='Fatal Error
- Line ' . $error['line'] . '
- Message ' . $error['message'] . '
- File ' . $error['file'] . '
Back
';
return $newBuffer;
}
return $buffer;
}