| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2001-12-11 23:02 UTC] zak@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 13:00:02 2025 UTC | 
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 ?>