Re: [RFC] Add get_error_handler(), get_exception_handler() functions
| From: | Jordi Boggiano | Date: | Tue, 18 Feb 2025 10:25:42 +0000 |
| Subject: | Re: [RFC] Add get_error_handler(), get_exception_handler() functions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-126440@lists.php.net to get a copy of this message | ||
On 11.02.2025 14:18, Arnaud Le Blanc wrote:
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.
Sounds good to me, straightforward clean-up of a weird API.
Best,
Jordi
--
Jordi Boggiano
@seldaek - https://seld.be