note 80884 added to function.set-error-handler
| From: | chugadie dot geo at yahoo dot com | Date: | Tue, 05 Feb 2008 17:37:23 +0000 |
| Subject: | note 80884 added to function.set-error-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135795@lists.php.net to get a copy of this message | ||
BE CAREFUL!
System generated exceptions are actually E_WARNINGS first before they are exceptions.
Tested on 5.2.3-5.2.5
Order of preference for exceptions generated by PHP (not user-land throw new Exception();}
1. set_error_handler();
2. set_exception_handler();
3. try/catch block in the code.
So, your custom error handler has to magically decide if any old E_WARNING is actually an exception
or not so it can return false for that one warning so it can be converted into a real exception and
handed off to your try/catch block.
This seriously cripples try/catch functionality around system generated exceptions (like new
DateTimeZone('zzzzzz');).
----
Server IP: 208.69.120.35
Probable Submitter: 67.149.236.232
----
Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php
Edit -- https://master.php.net/note/edit/80884
Del: integrated -- https://master.php.net/note/delete/80884/integrated
Del: useless -- https://master.php.net/note/delete/80884/useless
Del: bad code -- https://master.php.net/note/delete/80884/bad+code
Del: spam -- https://master.php.net/note/delete/80884/spam
Del: non-english -- https://master.php.net/note/delete/80884/non-english
Del: in docs -- https://master.php.net/note/delete/80884/in+docs
Del: other reasons-- https://master.php.net/note/delete/80884
Reject -- https://master.php.net/note/reject/80884
Search -- https://master.php.net/manage/user-notes.php