Skip to content

Array cast on ArrayObject reports non-existent values #12182

@kamil-tekiela

Description

@kamil-tekiela

Bug report

When casting an ArrayObject to an array the properties should not be reported as items in the array unless ArrayObject::ARRAY_AS_PROPS is set. See https://3v4l.org/CLt06

Code snippet that reproduces the problem

https://phpstan.org/r/dca2425a-4503-4b2a-9a4b-41e45f0e61b8

Expected output

Property HelloWorld::$a is never read, only written.
See: Always-read and written properties

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions