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

Result of in_array stored into variable is not enought for PHPStan array_shift(#1) #2980

Closed
Zarganwar opened this issue Feb 13, 2020 · 3 comments

Comments

@Zarganwar
Copy link

Zarganwar commented Feb 13, 2020

Bug report

PHPStan 0.12.10

Test for array type before using array_shift() function doesn't work if result of test is stored into variable.

Code snippet that reproduces the problem

https://phpstan.org/r/77b64d46-6237-41d5-bf76-0dff0b17ad08

Expected output

All three variants written in code snippet are same but they have not same result.

@ondrejmirtes
Copy link
Member

This falls under a considered (and complex) feature called Dependent types: https://github.com/phpstan/phpstan/milestone/12

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@a9d5c8b

@github-actions
Copy link

github-actions bot commented May 3, 2021

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 May 3, 2021
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