Skip to content

Associative array to named parameter incorrectly marked as missing #11815

@earthiverse

Description

@earthiverse

Bug report

I'm trying to create a new object based on an associative array, but I'm getting an error that the parameter is missing.

In the code snippet, if you rearrange lines 37 to 39, it always reports the last one as missing.

Code snippet that reproduces the problem

https://phpstan.org/r/bac0f5fb-3f24-49e7-808c-aab1609b1e33

Expected output

There should be no "Missing parameter" error.

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

PHPStan helps me and others on my team to reduce a LOT of bugs, thanks for all your hard work! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions