Skip to content

Switch case matching a class string does not narrow type to that class tring #4413

@BackEndTea

Description

@BackEndTea

Bug report

Matching a case statement in a switch case does not narrow the type to the matched type.

Code snippet that reproduces the problem

https://phpstan.org/r/1abaa184-34da-407e-8e7f-db4159c86002

Expected output

No errors

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions