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

Variable might not be defined with Match #7705

Open
mostafa-rz opened this issue Jul 27, 2022 · 1 comment
Open

Variable might not be defined with Match #7705

mostafa-rz opened this issue Jul 27, 2022 · 1 comment
Labels
Milestone

Comments

@mostafa-rz
Copy link

mostafa-rz commented Jul 27, 2022

Bug report

Hi, the match expression produces variable might not be defined incorrectly.

Code snippet that reproduces the problem

Playground-1
Playground-2

Expected output

no error.

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

maxresdefault

@ondrejmirtes
Copy link
Member

Yeah, this can be considered a bug, but you're using match like a switch :) This is the correct usage: https://phpstan.org/r/7cf7fdd3-ff74-4d52-a625-e1558600e80c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants