私は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」に変更するなどして意図的にスクリプトを壊すと、画面に致命的なエラーが出力され、メールが表示されなくなります。
そのようなエラーは、このタイプのエラーロギング/レポートの範囲を超えていますか?
私は何が間違っているのですか?