Bug #14445 Updated: undefined function not trapped by user defined error handler
| From: | zak@php.net | Date: | Wed, 12 Dec 2001 04:02:52 +0000 |
| Subject: | Bug #14445 Updated: undefined function not trapped by user defined error handler | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-73209@lists.php.net to get a copy of this message | ||
ID: 14445
Updated by: zak
Reported By: jlim@natsoft.com.my
Old Status: Open
Status: Duplicate
Bug Type: *General Issues
Operating System: Win2000
PHP Version: 4.0.6
New Comment:
Thank you for the report, however, please do check for
existing bug reports before opening a new bug report. This
is a duplicate of bug #9384 (See
http://bugs.php.net/bug.php?id=14445).
Previous Comments:
------------------------------------------------------------------------
[2001-12-11 22:11:40] jlim@natsoft.com.my
The following code is used to catch errors and mail them to the webmaster:
<?php
/* decide what errors to report */
error_reporting (E_ALL);
/* error handler function */
function MailErrorHandler($errno, $errstr, $errfile='?', $errline= '?')
{
print " Errno=$errno Errorstring=$errstr";
/* code deleted - mails error to webmaster */
}
set_error_handler('MailErrorHandler');
$undefined_var();
When the code above is run, I see in the browser window:
Errno=8 Errorstring=Undefined variable: undefined_var
Fatal error: Call to undefined function: () in d:\inetpub\wwwroot\php\err.php on line 14
In other words, the Fatal error is never caught by the error handler, and our webmaster never
detects that it is actually a very serious error, and not just an "undefined var"
E_NOTICE.
Thank you, John Lim
?>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14445&edit=1