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
Invalid assumptions about non-deterministic functions #7529
Comments
You can mark the function as impure: https://phpstan.org/r/ace57007-ea7f-43a7-9056-076f06e89607 See https://phpstan.org/blog/remembering-and-forgetting-returned-values for more information |
There's a new not-yet released option called It's going to be released soon. |
@rvanvelzen thanks for a hint, but I can not mark it. This is a 3rd party function. |
@Kolyunya You still can: https://phpstan.org/user-guide/stub-files But if I were you, I'd just wait for a new PHPStan release and used 1.7.x-dev meanwhile. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
PHPStan incorrectly assumes that the second call to a non-deterministic function would yield the same result.
Code snippet that reproduces the problem
https://phpstan.org/r/fb5391d6-50fb-4378-9c11-3306b911055f
Expected output
No issues should be reported.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps me every single day. Love you guys!
The text was updated successfully, but these errors were encountered: