Skip to content

Wrong detection of the parameter data type as mixed #12207

@zeleznypa

Description

@zeleznypa

Bug report

When the assignment into variable is a string, the PHPStan correctly detect, that variable is type of string.
But when the variable is declared as a part of the array definition (for the future usage in the same array), the PHPStan detect the type of the variable as mixed

Code snippet that reproduces the problem

https://phpstan.org/r/ecd2da08-0de4-4291-a956-b65947b1453d

Expected output

No error should be here

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