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

Skip to content

Cannot access offset in array with condition #13699

@imhdCePo

Description

@imhdCePo

Bug report

Consider the following example: https://phpstan.org/r/2b45c33b-4cd8-49ab-af72-2689640343d9

Error on line 8 should not exist. When condition on line 9 is removed, no error is reported. This issue started somewhere between version 2.1.22 and 2.1.31.

Code snippet that reproduces the problem

https://phpstan.org/r/2b45c33b-4cd8-49ab-af72-2689640343d9

Expected output

No errors

Did PHPStan help you today? Did it make you happy in any way?

No response

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