Skip to content

stream: remove path parameter in stream error functions#22792

Merged
Girgias merged 2 commits into
php:masterfrom
Girgias:2026-07-stream_error_api_path_args
Jul 19, 2026
Merged

stream: remove path parameter in stream error functions#22792
Girgias merged 2 commits into
php:masterfrom
Girgias:2026-07-stream_error_api_path_args

Conversation

@Girgias

@Girgias Girgias commented Jul 17, 2026

Copy link
Copy Markdown
Member

Instead rely on the mechanism gated by the error_include_args INI to display them.

Kinda realising that because https://wiki.php.net/rfc/display_error_function_args and https://wiki.php.net/rfc/stream_errors were voted in parrallel some of the interactions weren't really thought out.

Instead rely on the mechanism gated by the error_include_args INI to display them
@NattyNarwhal

Copy link
Copy Markdown
Member

I think the param property on the StreamError will be null this way. I think if we want to keep that property as-is on the stream error side, it'd be better to just knock out the php_error_docref1 call in php_stream_report_errors.

(FWIW as background: When I originally implemented error_include_args, I'm pretty sure it predated the stream errors effort. For that, I was also thinking of non-stream stuff and legacy code unlikely to adopt stream contexts, so the little overlap of weirdness here is that param property, which seems tied to streams being the only real php_error_docref1 consumer. Not sure what would be better on that side.)

@Girgias

Girgias commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

I think the param property on the StreamError will be null this way. I think if we want to keep that property as-is on the stream error side, it'd be better to just knock out the php_error_docref1 call in php_stream_report_errors.

(FWIW as background: When I originally implemented error_include_args, I'm pretty sure it predated the stream errors effort. For that, I was also thinking of non-stream stuff and legacy code unlikely to adopt stream contexts, so the little overlap of weirdness here is that param property, which seems tied to streams being the only real php_error_docref1 consumer. Not sure what would be better on that side.)

I will send an email to internals to hopefully get rid of the param property as it won't serve any purpose anymore :)

@bukka

bukka commented Jul 19, 2026

Copy link
Copy Markdown
Member

I just went through that RFC as I wasn't actually aware of it and agree that that the path can be dropped and if docref does not have any purpose then param and docref could be dropped too including the tweak but leave that to the different PR - this is aready way too big. It would be also good to extend the test with error_include_args=On and have there some stream functions to assert that this is all fine and params are there.

Btw that OPCACHE_VARIATION failing on mkdir - probably unrelated but worth double checking.

@Girgias

Girgias commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

I just went through that RFC as I wasn't actually aware of it and agree that that the path can be dropped and if docref does not have any purpose then param and docref could be dropped too including the tweak but leave that to the different PR - this is aready way too big. It would be also good to extend the test with error_include_args=On and have there some stream functions to assert that this is all fine and params are there.

I have a few tests that use the INI setting and everything works as intended.
And yes agreed, I've been splitting these PRs into smaller ones because there are a lot of test changes.

Btw that OPCACHE_VARIATION failing on mkdir - probably unrelated but worth double checking.

I'll double check.

@Girgias
Girgias merged commit 34c686a into php:master Jul 19, 2026
28 of 36 checks passed
@Girgias
Girgias deleted the 2026-07-stream_error_api_path_args branch July 19, 2026 15:15
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