Skip to content

Isset check on array is loosing generic of the values #7511

@VincentLanglet

Description

@VincentLanglet

Bug report

Follow up of #7460
and #7500

It seems like when using array<T of Foo> and using isset() then accesing a value, the value is just considered as Foo.

Code snippet that reproduces the problem

Original issue:
https://phpstan.org/r/cfa53647-37aa-400e-8c4d-27ff902a807d

But this can be simplified to https://phpstan.org/r/0fc99af2-13fd-4c7f-bd43-06408b41e56f

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions