Skip to content

spurious error nullCoalesce.offset #13921

@claudepache

Description

@claudepache

Bug report

See attached reduced testcase.

Note that:

  • the error does not occur when list<array<?string>> is replaced with list<array<string>> on line 3;
  • the error does not occur when $x[0] ?? null is accessed before $x[0]['bar'] ?? null on line 5.

Code snippet that reproduces the problem

https://phpstan.org/r/b22adb57-2821-465c-b3ad-625b98c8d6a1

Expected output

No error on line 6.

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

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions