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

Oscillating boolean is "always false" #8621

Closed
phinor opened this issue Dec 31, 2022 · 2 comments
Closed

Oscillating boolean is "always false" #8621

phinor opened this issue Dec 31, 2022 · 2 comments

Comments

@phinor
Copy link

phinor commented Dec 31, 2022

Bug report

A negated Boolean in a loop is used to oscillate between true and false on each iteration of the loop. PHPStan claims the expression is always false. This causes subsequent false positives in conditionals.

Code snippet that reproduces the problem

https://phpstan.org/r/7fffa805-d6b5-4397-a927-9b651294c76d

Expected output

No error.

The loop will ensure that the value changes on each iteration.

Did PHPStan help you today? Did it make you happy in any way?

I love this tool!

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@cde53d1

@github-actions
Copy link

github-actions bot commented Feb 4, 2023

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 Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants