Skip to content

Empty check should fail on undefined var #970

@muglug

Description

@muglug
function foo(array $arr) : void {
    if (!empty($ar['foo'])) {
        // do something
    }
}

Expected: $ar is undefined
Actual: No issue

Replacing !empty with isset triggers the correct output.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions