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
array<string, mixed>
array<int, mixed>
array<array-key, mixed>
The array<string, mixed> and array<int, mixed> accepts array<array-key, mixed> (even in Strict Mode). The array<string|int, mixed> will throw error as it should (see https://phpstan.org/r/1633c836-5f7a-46c3-ae91-08b5b5f768b8).
array<string|int, mixed>
https://phpstan.org/r/40b6815d-8143-4ef7-bf30-62cc18c0dfa6
Parameter #1 $array of method HelloWorld::bug() expects array<string, mixed>, array<array-key, mixed> given.argument.type Parameter #1 $array of method HelloWorld::bug2() expects array<int, mixed>, array<array-key, mixed> given.
Yep. It helps a lot while new package development.
The text was updated successfully, but these errors were encountered:
See: https://phpstan.org/config-reference#checkbenevolentuniontypes
Sorry, something went wrong.
Ahah, cool. Thanks :)
checkBenevolentUnionTypes
@template TKey of array-key
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
The
array<string, mixed>
andarray<int, mixed>
acceptsarray<array-key, mixed>
(even in Strict Mode). Thearray<string|int, mixed>
will throw error as it should (see https://phpstan.org/r/1633c836-5f7a-46c3-ae91-08b5b5f768b8).Code snippet that reproduces the problem
https://phpstan.org/r/40b6815d-8143-4ef7-bf30-62cc18c0dfa6
Expected output
Did PHPStan help you today? Did it make you happy in any way?
Yep. It helps a lot while new package development.
The text was updated successfully, but these errors were encountered: