Skip to content

FP: if+elseif string interpolation with same property with constant string #2220

@adaamz

Description

@adaamz

Bug report

When using comparison with interpolated string this way $var === "{$abc}xyz" phpstan complains about always false branch.

Code snippet that reproduces the problem

https://phpstan.org/r/2a56b69a-21ad-43f4-b04a-7e664d7532b2

Expected output

[OK] No error.

btw "normal" concat strings via concat dot operator is evaluated without error:
https://phpstan.org/r/ad40abdc-6790-47b5-bb1b-4264752ebf6f

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions