Mam następujący kod:
[php:1:1934eb93cf]<?php
error_reporting (E_ERROR | E_WARNING | E_PARSE);
function error_handler($errno, $errstr, $errfile, $errline) {
$error_text = "Wystapił bład"
. "Data: " . date("Y-m-d, H:i:s") . "n"
. "Numer błędu: $errnon"
. "Tresć błędu: $errstrn"
. "Plik: $errfilen"
. "Linia: $errlinenn";
@error_log($error_text, 1, "user@127.0.0.1");
@error_log ($error_text, 3, "my-errors.log");
echo "Wystąpił błąd podczas wyświetlania strony. Administrator
serwisu został już powiadomo o tym fakcie. Proszę spróbować później.
Przepraszamy.<BR>";
echo "The web site is not available at this time. Administrator of
the website was already notified about this. Please try again soon.";
exit(1);
}
set_error_handler('error_handler');
?>[/php:1:1934eb93cf]
Nawet jak ustawię error_reporting(0) to dostaję wiadomość
[php:1:1934eb93cf]<?php
Wystąpił błąd w serwisie http://localhost/xxxxxxx
Data: 2003-10-24, 12:32:46
Numer błędu: 8
Treść błędu: Undefined variable: where
Plik: d:wwwxxxxxxxxxxxxzamowienia.php
Linia: 23
?>[/php:1:1934eb93cf]
Tak jakby set_error_handler nie uwzględniało nie informowania o
błędach typu NOTICE
Czy jedynym rozwiązaniem jest kombinowowanie typu
if ($errno == E_NOTICE && substr($errstr, 0, 20) == "Undefined
variable: ") return;