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

bool|null is accepted in an if condition if you use the nullsafe operator. #135

Closed
Dgame opened this issue Sep 15, 2021 · 2 comments
Closed

Comments

@Dgame
Copy link

Dgame commented Sep 15, 2021

Bug report

bool|null is accepted in an if condition if you use the nullsafe operator.

Code snippet that reproduces the problem

No error for line 13:
https://phpstan.org/r/6866ee85-dfc4-4b09-9b39-83861c2cdda6

Expected output

I expected the error Only booleans are allowed in an if condition, bool|null given.

@ondrejmirtes
Copy link
Member

Fixed by: phpstan/phpstan-src#687

@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 Nov 12, 2021
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