Problem with ErrorHandler

From: Date: Tue, 12 Mar 2002 10:35:08 +0000
Subject: Problem with ErrorHandler
Groups: php.general 
Request: Send a blank email to php-general+get-88173@lists.php.net to get a copy of this message
Hi PHPzers How can I capture Error thrown by php for Non existent or undefined function. I used set_error_handler() but its returning its returning false. Anyway it gets called for NON-existent CONSTANT but not for Non-existent function. Can any one tell me what is going on here and solution to the above problem. Here is the code. Iam using PHP 4.1.1 <?php function ErrorHandler($Errcode, $Errmsg ) { if(!($Errcode & error_reporting())) { print "Returning from ErrorHandler\n" ; return ; } print "ErrorCode: " . $Errcode . "\n" ; print "ErrorMsg : " . $Errmsg . "\n" ; return false ; } error_reporting(E_ALL); if(!set_error_handler("ErrorHandler")) { print "Unable to set error handler\n" ; } print SOME_CONSTANT ; Some_Non_Existing_func(); ?> Hope some light on this. Thanks. smk_bk@yahoo.com

« previous php.general (#88173) next »