Bug report
Trying out PHPStan v2.0.1, I started noticing in various reports the type array<mixed, mixed>. I believe the largest possible array value is array<int|string, mixed>, so should it even be possible to instantiate a type larger than that?
I ran into the following error which, unless I'm missing something, makes no sense:
Parameter #1 $a of function foo expects array<int|string, mixed>, array<mixed> given.
argument.type
Type array<mixed> should always be equivalent to array<int|string, mixed>.
Code snippet that reproduces the problem
https://phpstan.org/r/b6e2e23b-0605-4956-bced-a5b8be0682de
Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
Trying out PHPStan v2.0.1, I started noticing in various reports the type
array<mixed, mixed>. I believe the largest possible array value isarray<int|string, mixed>, so should it even be possible to instantiate a type larger than that?I ran into the following error which, unless I'm missing something, makes no sense:
Type
array<mixed>should always be equivalent toarray<int|string, mixed>.Code snippet that reproduces the problem
https://phpstan.org/r/b6e2e23b-0605-4956-bced-a5b8be0682de
Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
No response