Skip to content

Assigning the condition in a variable raises an error #2977

@roukmoute

Description

@roukmoute

Bug report

If I assign a condition in a variable or in a method, phpstan brings me up a false error, I think.

Code snippet that reproduces the problem

https://phpstan.org/r/488425af-8e61-453e-b327-1084560a8b3d

Expected output

https://phpstan.org/r/470bbfe6-0518-4ea2-ae05-68742135bae6

The only difference between theses two links is on line 54:

-if (!$case) {
+if (!$parent) {

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions