Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The flag STREAM_REPORT_ERRORS is never sent to the StreamWrapper #3010

Open
GromNaN opened this issue Dec 12, 2023 · 1 comment
Open

The flag STREAM_REPORT_ERRORS is never sent to the StreamWrapper #3010

GromNaN opened this issue Dec 12, 2023 · 1 comment

Comments

@GromNaN
Copy link
Member

GromNaN commented Dec 12, 2023

As I understand it, since php/php-src#6190, the flag STREAM_REPORT_ERRORS is never sent to the StreamWrapper instances.

The documentation should be updated, as it is not necessary to have code that handle this flag.

<entry><constant>STREAM_REPORT_ERRORS</constant></entry>
<entry>If this flag is set, you are responsible for raising
errors using <function>trigger_error</function> during
opening of the stream. If this flag is not set, you
should not raise any errors.
</entry>

<entry><constant>STREAM_REPORT_ERRORS</constant></entry>
<entry><literal>Flag</literal> indicating if the <literal>wrapper</literal>
is responsible for raising errors using <function>trigger_error</function>
during opening of the stream. If this flag is not set, you
should not raise any errors.
</entry>

What should be the best practice when implementing a StreamWrapper, in case of error? Returning false silently, trigger a E_USER_ERROR or throwing an exception?

@Girgias
Copy link
Member

Girgias commented Dec 15, 2023

@bukka could you have a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants