Skip to content

String literals check #10492

@DonCallisto

Description

@DonCallisto

Bug report

Hi, i think the following is a bug https://phpstan.org/r/3852d3d0-5965-4945-be76-012889331d21 as key 4 is not defined.
I would like to point out that if no (partial) match is found in the caller, PHPStan raise an error https://phpstan.org/r/44be467d-deef-4b69-8914-2273fca08b8f so the bug seems in checks and not in return type values assignment.

Moreover if that's not a bug I think it's at best a really confusing behaviour.

Code snippet that reproduces the problem

No response

Expected output

PHPStan to warn about index 4 not defined

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

No response

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