Re: [RFC] Stream Error Handling Improvements
| From: | Arnaud Le Blanc | Date: | Fri, 12 Dec 2025 12:29:02 +0000 |
| Subject: | Re: [RFC] Stream Error Handling Improvements | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129594@lists.php.net to get a copy of this message | ||
Hi Jakub,
On Tue, Nov 18, 2025 at 7:39 PM Jakub Zelenka <bukka@php.net> wrote:
>
> Hello,
>
> I would like to introduce a new stream error handling RFC that is part of my stream evolution
> work (PHP Foundation project funded by Sovereign Tech Fund) :
>
> https://wiki.php.net/rfc/stream_errors
>
> Kind regards,
>
> Jakub
Thank you for working on this.
The RFC doesn't specify when exactly the error_handler is invoked
(especially in case of non-fatal errors). Is it as soon as the error
happens, or are invocations batched at the end of the operation?
The reason I'm asking is because there is a long track of bugs related
to the global error handler [1], and it's likely that the
error_handler proposed here could suffer from the same issues. For
example the error_handler can reenter the operation being performed,
or change the state of the stream. For safety and simplicity, I would
suggest that error_handler calls are delayed until just before
returning to user code.
[1] https://github.com/php/php-src/issues/20018
Best Regards,
Arnaud