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

PHPStan wrong processing a null coalescing operator #1823

Closed
ossinkine opened this issue Jan 21, 2019 · 2 comments
Closed

PHPStan wrong processing a null coalescing operator #1823

ossinkine opened this issue Jan 21, 2019 · 2 comments

Comments

@ossinkine
Copy link

Summary of a problem or a feature request

If left side of null coalescing operator is not null then right side will never be used.
PHPStan should alert it.

Code snippet that reproduces the problem

https://phpstan.org/r/19e311df-cf34-4cb2-8d38-92e8bbe8d8bd

Expected output

PHPStan should say something like "Variable $foo always exists and is not nullable."

@ondrejmirtes
Copy link
Member

@lock
Copy link

lock bot commented Apr 2, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants