Skip to content

Type lost when assigning variable in method argument #12234

@PrinsFrank

Description

@PrinsFrank

Bug report

When calling a method/function, and assigning a variable for one of the arguments of that method/function, the type is lost for subsequent method arguments:

foo(
    $bar = new A();
   // $bar->getInt() is evaluated as mixed here
)

Code snippet that reproduces the problem

https://phpstan.org/r/8d3536cc-d647-455c-8919-300cc35d7abf

Expected output

The snippet should not cause any errors

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions