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

FP assuming method purity even after state change in bleeding edge #5501

Closed
dktapps opened this issue Aug 21, 2021 · 5 comments
Closed

FP assuming method purity even after state change in bleeding edge #5501

dktapps opened this issue Aug 21, 2021 · 5 comments
Labels
Milestone

Comments

@dktapps
Copy link
Contributor

dktapps commented Aug 21, 2021

Bug report

This only happens when bleedingEdge is used.

Code snippet that reproduces the problem

https://phpstan.org/r/7630b305-3559-42e6-b125-a876bcce437e
https://phpstan.org/r/8f63b716-d2b7-4dca-b41f-98659f991e35

Expected output

Both samples should be error-free, because $this->damage is modified directly before the isBroken() call, which may cause a different result to be returned.

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Aug 22, 2021
@phpstan-bot
Copy link
Contributor

@dktapps After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-No errors
+25: If condition is always false.
Full report
Line Error
25 If condition is always false.

@dktapps
Copy link
Contributor Author

dktapps commented Sep 22, 2021

now both samples have the bogus error..??

@ondrejmirtes
Copy link
Member

If you check out today's commits in master, you'll understand why.

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@5f91da6

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants