php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14445 undefined function not trapped by user defined error handler
Submitted: 2001-12-11 22:11 UTC Modified: 2001-12-12 12:16 UTC
From: jlim at natsoft dot com dot my Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.6 OS: Win2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jlim at natsoft dot com dot my
New email:
PHP Version: OS:

 

 [2001-12-11 22:11 UTC] jlim at natsoft dot com dot 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

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-11 23:02 UTC] zak@php.net
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).

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Sep 17 07:01:28 2024 UTC