Am 29.12.2025 um 19:52 schrieb Jakub Zelenka <[email protected]>:
> - The storing of errors is done at the end of the operation grouping and
> contains only the last grouped errors. So the function name was changed to
> stream_get_last_error(). It returns just a single StreamError which has a
> next property pointing to the next error if there is any.
I assume the chaining was based on Exception chaining but the example code under
https://wiki.php.net/rfc/stream_errors#error_chaining
looks a bit clunky to me and I was wondering if returning an array of
StreamError would not be more straightforward, i.e. one could then use foreach,
empty(), count(), array_first(), array_last(), array_find() etc. instead of
methods like while, $e->count(), $e->hasCode() which would make it feel more
idiomatic to me.
But then again it might be a matter of taste and/or I might have missed
something.
Regards,
- Chris