You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a call to error_log failed because it was unable to write to a file, the identical call might succeed later if in between the situation concerning the target file changed. Hence, error_log should be considered impure.
Unfortunately PHPStan considers all functions that return a value to be pure by default. I strongly disagree but that's not what this particular issue is about.
In my example I even reset the stat cache. I think this sufficed in the past so this might be a regression.
For the time being my workaround is to put rememberPossiblyImpureFunctionValues: false in the config. I might actually keep that there irrespective of whether this issue will be fixed or not.
Bug report
If a call to
error_log
failed because it was unable to write to a file, the identical call might succeed later if in between the situation concerning the target file changed. Hence, error_log should be considered impure.Unfortunately PHPStan considers all functions that return a value to be pure by default. I strongly disagree but that's not what this particular issue is about.
In my example I even reset the stat cache. I think this sufficed in the past so this might be a regression.
For the time being my workaround is to put
rememberPossiblyImpureFunctionValues: false
in the config. I might actually keep that there irrespective of whether this issue will be fixed or not.Code snippet that reproduces the problem
https://phpstan.org/r/26928297-bb3d-450a-98d3-b2eb62208606
Expected output
No warnings/errors
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: