Skip to content

Stream errors - #20524

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

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

Conversation

@bukka

@bukka bukka 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

@DanielEScherzer DanielEScherzer 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
bukka force-pushed the stream_errors branch 3 times, most recently from e729e8e to 176987f Compare April 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_errors

Closes phpGH-20524
@bukka bukka closed this in f2b371e May 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

jrfnl commented Aug 22, 2026

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 free to 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