Skip to content

False positive InvalidArrayOffset with Enum name #10090

@blackwolf12333

Description

@blackwolf12333

When you use the name of an enum value as check in an isset in an array you get an error that an option in the enum that is not defined in the array that's indexed exists. However that's what the isset check is there for, so this shouldn't report an error.

The reproducer below shows the issue clearly

https://psalm.dev/r/50c582c00b

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions