我正在使用 nettuts 的以下脚本:
// Our custom error handler
function error_engine($number, $message, $file, $line, $vars)
{
$email = "
<p>An error ($number) occurred on line
<strong>$line</strong> and in the <strong>file: $file.</strong>
<p> $message </p>";
$email .= "<pre>" . print_r($vars, 1) . "</pre>";
$headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Email the error to someone...
error_log($email, 1, 'example@example.com', $headers);
if ( ($number !== E_NOTICE) && ($number < 2048) ) {
die("There was an error. Please try again later.");
}
}
// We should use our custom function to handle errors.
set_error_handler('error_engine');
它适用于通知和警告等,但是当我故意破坏我的脚本时,比如将“mysqli_connect”更改为“mysqy_connct”,我会在屏幕上打印出致命错误并且没有电子邮件!
此类错误是否超出了此类错误记录/报告的范围?
我究竟做错了什么?