Skip to content

PHPStan found error: "expects TKey of (int|string), int|string given" #8268

@Neila142

Description

@Neila142

Bug report

I've wanted to work with a generic Collection who use an internal array, but PHPStan show error:
expects TKey of (int|string), int|string given.

Which is really bugging me and I can't understand what doesn't work...

Code snippet that reproduces the problem

https://phpstan.org/r/03249bef-7e11-455d-966f-25921972e7e5

Expected output

I thing PHPStan should not show any error there...

Did PHPStan help you today? Did it make you happy in any way?

PHPStan help me a lot of the time to find error before merging, that's a very nice tool!, If it's support as much options as psalm it would be perfect (just messing around 🙃Don't worry PHPStan is still amazing 👍)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions