note 76300 added to function.set-exception-handler

From: Date: Mon, 09 Jul 2007 22:41:43 +0000
Subject: note 76300 added to function.set-exception-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-128346@lists.php.net to get a copy of this message
I've been messing around with this function, and have noticed you can pass an anonymous function (created with create_function()) through as the default handler, for example: set_exception_handler(create_function('$e', 'exit("An unknown error occurred");')); That snippet of code can be used if you simply want to suppress all exceptions that are not handled. This can be a great thing, because secure data could possibly be leaked otherwise (for example, the default exception handler could output a snippet of your SQL code that was involved with the exception being thrown). You will want to use this wisely, however (if at all). ---- Server IP: 64.71.164.2 Probable Submitter: 24.255.168.100 ---- Manual Page -- http://www.php.net/manual/en/function.set-exception-handler.php Edit -- https://master.php.net/note/edit/76300 Del: integrated -- https://master.php.net/note/delete/76300/integrated Del: useless -- https://master.php.net/note/delete/76300/useless Del: bad code -- https://master.php.net/note/delete/76300/bad+code Del: spam -- https://master.php.net/note/delete/76300/spam Del: non-english -- https://master.php.net/note/delete/76300/non-english Del: in docs -- https://master.php.net/note/delete/76300/in+docs Del: other reasons-- https://master.php.net/note/delete/76300 Reject -- https://master.php.net/note/reject/76300 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128346) next »