Re: error_handler

From: Date: Fri, 19 Dec 2003 19:02:43 +0000
Subject: Re: error_handler
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-6623@lists.php.net to get a copy of this message
On Fri, Dec 19, 2003 at 08:15:15PM +0200, Zeev Suraski wrote: > > You may very well shut all errors off in > production code, and rely on everything going through your error > handler. That already happens in ALL code which utilizes user defined error processing. Once a custom error handler is defined, all of the normal error processing gets turned off and error reporting settings are ignored. So, in PHP 4, there's no incentive for such programmers to set error_reporting to some other level. > Just supply it in both PHP 4 and 5 - extra arguments are ignored anyway Nope... CODE ---- echo phpversion(); set_error_handler('error_handler', 0); function error_handler($code, $text) { echo "<br />Handled... $text"; } $x; OUTPUT ------ 4.3.4 Warning: Wrong parameter count for set_error_handler() in y on line 4 Notice: Undefined variable: x in y on line 8 > (just provide @ to make sure of that). Nope... Sure, adding a @ to the set_error_handler() call supresses the parameter count warning. But, since set_error_handler() failed, the error handler doesn't get called... OUTPUT ------ 4.3.4 Notice: Undefined variable: x in y on line 8 --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

« previous php.internals (#6623) next »