note 93261 deleted from function.restore-error-handler by googleguy

From: Date: Tue, 22 Oct 2013 11:16:27 +0000
Subject: note 93261 deleted from function.restore-error-handler by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-197059@lists.php.net to get a copy of this message
Note Submitter: Timo Frenay ---- While looking through some old code I found this trick I once used for restoring the built-in error handler: <?php // Unwind the error handler stack until we're back at the built-in error handler. function unset_error_handler() { while (set_error_handler(create_function('$errno,$errstr', 'return false;'))) { // Unset the error handler we just set. restore_error_handler(); // Unset the previous error handler. restore_error_handler(); } // Restore the built-in error handler. restore_error_handler(); } ?>

« previous php.notes (#197059) next »