Skip to content

Calling isset('key', $array) returns an unexpected error during phpstan scan.  #4290

@tadasaa

Description

@tadasaa

Bug report

Calling isset('key', $array) on an array that might or might not contain the specified key throws an error during phpstan scan. Only reproducable with bleeding edge. Recent 0.12.50 => 0.12.64 version update introduced this.

Reproduced here:
https://phpstan.org/r/4f2e4423-2a47-4b5d-ad57-d467df4c0340

Expected output

In the given example, the 'status' field might not exist in the $array, therefore array filter will return $data as an array with one value, but no 'status' key. Therefore the check on line 18 is expected to work correctly and not throw any phpstan problems.

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