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
Looping through an array shape has wrong count #3339
Comments
Partially resolves phpstan/phpstan#3339
Partially resolves phpstan/phpstan#3339
Partially resolves phpstan/phpstan#3339
@allejo After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-14: Array (array<int, bool>) does not accept key int<min, 2>.
+14: Array (array(bool, bool, bool)) does not accept key int<min, 2>. Full report
|
@allejo After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-14: Array (array<int, bool>) does not accept key int<min, 2>.
+14: Array (array{bool, bool, bool}) does not accept key int<min, 2>. Full report
|
@allejo After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-14: Array (array<int, bool>) does not accept key int<min, 2>.
+ 6: Property HelloWorld::$tuple is never read, only written.
+14: Array (array{bool, bool, bool}) does not accept key int<min, 2>. Full report
|
@allejo After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-14: Array (array<int, bool>) does not accept key int<min, 2>.
+ 6: Property HelloWorld::$tuple is never read, only written.
+14: Property HelloWorld::$tuple (array{bool, bool, bool}) does not accept non-empty-array<int<min, 2>, false>. Full report
|
@allejo After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-14: Array (array<int, bool>) does not accept key int<min, 2>.
+ 6: Property HelloWorld::$tuple is never read, only written.
+14: Property HelloWorld::$tuple (array{bool, bool, bool}) does not accept non-empty-array<int<0, 2>, false>. Full report
|
@allejo After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-14: Array (array<int, bool>) does not accept key int<min, 2>.
+ 6: Property HelloWorld::$tuple is never read, only written. Full report
|
Fixed: phpstan/phpstan-src@3b5fd94 |
Thank you for the fix! 🥳 |
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. |
Bug report
Given I'm using an array shape like
array{bool, bool, bool}
, it expects a key ofint<min, 2>
, where I would think it should beint<min, 3>
or make it inclusive?Code snippet that reproduces the problem
https://phpstan.org/r/eaaf2943-60db-49fa-9336-a2dead66c788
Expected output
I would think PHPStan should accept this code as valid.
The text was updated successfully, but these errors were encountered: