Skip to content

FP on dynamic second parameter to instanceof #2907

@dktapps

Description

@dktapps

Bug report

Due to LSP, the class of an object may be a subclass of the documented type, which appears not to be respected during instanceof.

Code snippet that reproduces the problem

https://phpstan.org/r/fa44c3a7-3f89-4bc8-a23c-94f01e9b9227

Expected output

No error should be reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions