Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Offset does not exist on multidimensional array in very specific circumstances #4829

@shorsman

Description

@shorsman

Bug report

I had an offset reported as not exisiting right after assigning a value to that offset, but only in very specific circumstances.
See code snippet below. I added comments to show when the error does or doesn't occur

Code snippet that reproduces the problem

https://phpstan.org/r/c7ca6a8c-387d-40a2-b18a-360e473e2783

Expected output

No errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions