Skip to content

Wrong message - Instanceof between Xxx and string #5728

@mvorisek

Description

@mvorisek

Bug report

Right part of instanceof operator can be a string. This is correctly evaluated by phpstan, however, the message is wrong and should display the actual given type.

Code snippet that reproduces the problem

https://phpstan.org/r/75cfa710-5a60-4be6-b706-e48cb685f453

Expected output

 Instanceof between DateTimeImmutable and DateTime will always evaluate to false.
-Instanceof between DateTimeImmutable and string will always evaluate to false.
+Instanceof between DateTimeImmutable and DateTime will always evaluate to false.

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