Skip to content

False positive: offset 1 on array does not exist #9328

@EreMaijala

Description

@EreMaijala

Bug report

PHPStan versions starting with 1.10.11 reports the error Offset 1 on array<0, array{name: string, lines: non-empty-array<int<0, max>, string>}> in isset() does not exist. for the example code snippet. Version 1.10.10 does not suffer from this issue.

Code snippet that reproduces the problem

https://phpstan.org/r/fca2eeda-2636-47d5-9ba5-4c501ec5e9b5

Expected output

No errors reported.

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

It sure did! It caught a couple of other edge cases that would have slipped through otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions