[RFC] Add get_error_handler(), get_exception_handler() functions
| From: | Arnaud Le Blanc | Date: | Tue, 11 Feb 2025 13:18:19 +0000 |
| Subject: | [RFC] Add get_error_handler(), get_exception_handler() functions | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-126372@lists.php.net to get a copy of this message | ||
Hi,
At the moment, there is no direct way to fetch the currently
registered error or exception handlers. Users who need to inspect
these handlers must resort to a workaround that temporarily sets a new
handler and then immediately restores the previous one:
$current_error_handler = set_error_handler('valid_callback');
restore_error_handler();
This feels hackish and is error-prone.
I would like to propose the addition of two new functions:
get_error_handler(), get_exception_handler() to address this:
https://wiki.php.net/rfc/get-error-exception-handler
Best Regards,
Arnaud