note 49132 added to function.set-error-handler

From: Date: Mon, 17 Jan 2005 19:39:14 +0000
Subject: note 49132 added to function.set-error-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-83518@lists.php.net to get a copy of this message
In PHP5, you're able to set multiple error handlers to handle specific error types. However, be careful when you set multiple error handlers, as they may turn off error handling for other error types. <? // set the generic error handler set_error_handler('generic_handler'); // this error handler will print out our form when the user makes a mistake, but now errors other than E_USER_WARNING will use the default error handler, not generic_handler set_error_handler('fix_form_handler', E_USER_WARNING); // this sets things the way we want: // fix_form_handler takes care of E_USER_WARNING // generic_handler takes care of all other error types set_error_handler('generic_handler', E_ALL | E_USER_WARNING); ?> ---- Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49132 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49132&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49132&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49132&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49132&report=yes&reason=useless+example Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49132&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49132&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83518) next »