Skip to content

get_class comparison doesn't pass the generic #6294

@VincentLanglet

Description

@VincentLanglet

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/97ceedb3-7f60-48aa-ae99-8a60d8d56736

Expected output

Since $object is T, get_class($object) is class-string.
With the === check, I expect $object2 to be considered as T too.

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

Yes, I'm using the strict rules today to detect some bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions