Skip to content

Switch behaviour different for get_class and ::class #5843

@marmichalski

Description

@marmichalski

Bug report

Switch using ::class on object does not track object type in case blocks.

Code snippet that reproduces the problem

https://phpstan.org/r/2bfd9101-de21-44ad-a7b0-6a96ebe9cdf7

Expected output

No errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions