Skip to content

Inconsistent behavior for variables defined in arrays vs before #13944

@jack-worman

Description

@jack-worman

Bug report

A variable defined inside an array and reused gives a typing error, but the equivalent variable defined before the array gives no error.

Code snippet that reproduces the problem

Original: https://phpstan.org/r/a7432d04-8072-4247-bd60-cda63fd86b69
Reduced: https://phpstan.org/r/e17f2045-52eb-4d22-8b79-8220f90986a5

Expected output

No 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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions