note 73239 deleted from function.set-error-handler by cmb
| From: | cmb@php.net | Date: | Sun, 13 Oct 2019 07:37:40 +0000 |
| Subject: | note 73239 deleted from function.set-error-handler by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212594@lists.php.net to get a copy of this message | ||
Note Submitter: elven_rangers at yahoo dot com
----
Unfortunately, none of the procedures described here by other users to catch all errors work.
Then again this would be impossible as parse errors are triggered before the code is interpreted and
executed so no code solution is possible (just as the documentation says).
You can test them easily against this simple code:
some_function_that_doesnt_exist();
using it in this form will trigger a Fatal Error (call to undefined function), which can't be
caught by using your custom defined handler but *can* be caught by using the solutions presented by
other programmers.
if you remove the ; from the end will trigger a Parse Error (syntax error), which *can't* be
caught by any of these solutions. If this called is however places as the last line of code, just
before the ?> then it will again generate a Fatal Error (call to undefined function).
if you further remove the () then you'll get a Notice (undefined constant) which can be caught
by the manual method of defining a custom error handler.