Skip to content

ArrayAccess intersection type "Offset doesn't exist" false positive #3836

@endrsmar

Description

@endrsmar

Bug report

Accessing offset on an ArrayAccess produces "Offset ... doesn't exist on ... ." if the ArrayAccess is an intersection type with some other interface.

Code snippet that reproduces the problem

https://phpstan.org/r/7dff47d7-1925-4fa0-827c-403cab280b0a

Expected output

No errors, since both fooC and fooD are \ArrayAccess<string, mixed>, just like fooA and fooB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions