Error Handler Problem

From: Date: Sat, 09 Mar 2002 13:42:49 +0000
Subject: Error Handler Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-87872@lists.php.net to get a copy of this message
Hi All, I tell my requierment first. Just in short I want to capture a error of "Undefined Function .so and so..." . I set Error Handler to E_ALL & ~E_ERROR and I set my own Error Handler to capture errors then I called a Non-Existent Function intentionally. in this case its not at all capturing the error and silently executing the program. Can anyone tell me what is the workaround this. For clarification here is the code. <?php function ErrorHandler($Errcode, $Errmsg ) { print "ErrorCode: " . $Errcode . "\n" ; print "ErrorMsg : " . $Errmsg . "\n" ; return false ; } error_reporting(E_ALL & ~E_ERROR); $prev_hand = set_error_handler("ErrorHandler"); // It's always executing if section instead of else. if(!$prev_hand) { print "Unable to set error handler\n" ; } else { print "Previous Handler" . $prev_hand ; } ?> <smk_bk@yahoo.com> ------------------------------------------------------------------- We must use time wisely and forever realize that the time is always ripe to do right." -- Nelson Mandela -------------------------------------------------------------------

« previous php.general (#87872) next »