We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
mixed
PHPStan 1.6.2
If a variable is narrowed from mixed to a shaped array, PHPStan fails to compare it properly. https://phpstan.org/r/8273475b-6e96-4e2d-baa0-7a0fea921fc0 The same code doesn't yield any errors if I just replace mixed with array: https://phpstan.org/r/98b21779-1265-465e-ab65-0967bf6feb8f
array
https://phpstan.org/r/8273475b-6e96-4e2d-baa0-7a0fea921fc0
No errors.
❤️ ❤️ ❤️
The text was updated successfully, but these errors were encountered:
This works if bleeding edge is not used. I wonder if my explicit mixed is_array changes are the reason :/ phpstan/phpstan-src#1191
is_array
Sorry, something went wrong.
@fluffycondor After the latest push in 1.8.x, PHPStan now reports different result with your code snippet:
@@ @@ -16: Dumped type: array&hasOffset('value') -18: Parameter #1 $foo of function foo expects array{value: string}, array given. +16: Dumped type: array&hasOffsetValue('value', string)
Dumped type: array&hasOffsetValue('value', string)
@@ @@ -19: Dumped type: array&hasOffset('value') +19: Dumped type: array&hasOffsetValue('value', string)
phpstan/phpstan-src@5d7a1a5
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.
No branches or pull requests
Bug report
PHPStan 1.6.2
If a variable is narrowed from
mixed
to a shaped array, PHPStan fails to compare it properly.https://phpstan.org/r/8273475b-6e96-4e2d-baa0-7a0fea921fc0
The same code doesn't yield any errors if I just replace
mixed
witharray
:https://phpstan.org/r/98b21779-1265-465e-ab65-0967bf6feb8f
Code snippet that reproduces the problem
https://phpstan.org/r/8273475b-6e96-4e2d-baa0-7a0fea921fc0
Expected output
No errors.
Did PHPStan help you today? Did it make you happy in any way?
❤️ ❤️ ❤️
The text was updated successfully, but these errors were encountered: