Skip to content

Assignment in a key of array destructuring is ignored #14019

@takaram

Description

@takaram

Bug report

In this code, PHPStan misses the assignment to $a.

[($a = 'foo') => $b] = ['foo' => 1];

$a is actually assigned.
https://3v4l.org/U593s

Code snippet that reproduces the problem

https://phpstan.org/r/6cf214ae-c4f8-48a5-8d82-3efe7087e842

Expected output

No error

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