note 80884 deleted from function.set-error-handler by derick

From: Date: Wed, 19 Mar 2008 11:03:33 +0000
Subject: note 80884 deleted from function.set-error-handler by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-137197@lists.php.net to get a copy of this message
Note Submitter: chugadie dot geo at yahoo dot com ---- 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');).

« previous php.notes (#137197) next »