Skip to content

Stream errors - #20524

Closed
bukka wants to merge 1 commit into
php:masterfrom
bukka:stream_errors
Closed

Stream errors#20524
bukka wants to merge 1 commit into
php:masterfrom
bukka:stream_errors

Conversation

@bukka

@bukkabukka commented Nov 18, 2025

Copy link
Copy Markdown
Member

This introduces new stream error handling that allows configurable handling of stream errors. This can be configured in stream contex.

RFC: https://wiki.php.net/rfc/stream_errors

@DanielEScherzerDanielEScherzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt for new classes looks good to me, okay for ext/reflection

@bukka
bukkaforce-pushed the stream_errors branch 3 times, most recently from e729e8e to 176987fCompareApril 2, 2026 18:06
This introduces new stream error handling that allows configurable
handling of stream errors. This can be configured in stream contex.
All streams, ext/standard and ext/phar stream errors are converted to
use the new API.
RFC: https://wiki.php.net/rfc/stream_errorsClosesphpGH-20524
@bukkabukka closed this in f2b371eMay 29, 2026
bukka pushed a commit that referenced this pull request Jun 14, 2026
Since GH-20524, _php_stream_open_wrapper_ex() attaches the context to a
stream that has none, including the implicitly substituted default
context. Sharing the default context by reference let a later
stream_context_set_option() on the stream mutate the global default
context, leaking options into every other context-less stream.
Only attach explicitly provided contexts. Stream errors already fall
back to the default context when the stream has none, so error handling
is unaffected.
@jrfnl

Copy link
Copy Markdown
Contributor

Quick question: the RFC for this PR is still listed under "Pending Implementation / Landing". Is there anything still missing ? Or should this RFC be moved into the "Implemented in PHP 8.6" list ?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@bukka@jrfnl@DanielEScherzer