Bug report
Given that an array's keys can only (natively) be int|string, I would have expected numeric-string to be understood as an array-key or int|string when used as an array's keys and/or when trying to access an array's value using a numeric-string as the offset.
Code snippet that reproduces the problem
https://phpstan.org/r/1cdf1f0e-b232-40c3-9a0f-f0b4a7007e1c
Expected output
No errors. I would have also expected the value to be returned by \PHPStan\dumpType($tagsById) to be array<int|string, array{id: numeric-string, tagName: string}>.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan is wonderful! I've found it brings a lot more stability and safety to PHP code.
Bug report
Given that an array's keys can only (natively) be
int|string, I would have expectednumeric-stringto be understood as anarray-keyorint|stringwhen used as an array's keys and/or when trying to access an array's value using anumeric-stringas the offset.Code snippet that reproduces the problem
https://phpstan.org/r/1cdf1f0e-b232-40c3-9a0f-f0b4a7007e1c
Expected output
No errors. I would have also expected the value to be returned by
\PHPStan\dumpType($tagsById)to bearray<int|string, array{id: numeric-string, tagName: string}>.Did PHPStan help you today? Did it make you happy in any way?
PHPStan is wonderful! I've found it brings a lot more stability and safety to PHP code.