Skip to content

FP: object casted to array does not consider child class properties #2730

@dktapps

Description

@dktapps

Bug report

When casting an object to array, PHPStan appears not to consider that properties in child classes will also be included when iterating.

Code snippet that reproduces the problem

https://phpstan.org/r/f1bfae15-4eb5-4ca4-95f9-d7fc84983274

Expected output

No error should be reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions