Skip to content

Invalid offset-does-not-exist-on-array error #1062

@muglug

Description

@muglug
function foo(string $s) : void {
    $a = [
        'b' => ['c' => false],
        'c' => ['c' => true],
        'd' => ['e' => true]
    ];
    if (isset($a[$s]['c'])) {} // this should definitely be fine
}

Expected: no issue
Actual: Offset 'c' does not exist on array('c' => bool)|array('e' => true).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions