Skip to content

PHPStan thinks variance of ReflectionClass<T> is different in 8.4 vs earlier versions #13452

@dktapps

Description

@dktapps

Bug report

Per title.

I can't seem to make it happy in all versions. Adding covariant to the types makes it complain on the older versions that the variance is redundant.

Code snippet that reproduces the problem

https://phpstan.org/r/52872ee9-9215-4eb7-8d03-a0ff6ced4d0c

Expected output

Not sure, but all versions should report the same errors (or all versions should report no errors)

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions