Skip to content

Array keys are not always set #3126

@BackEndTea

Description

@BackEndTea

Bug report

When doing an isset before setting a key in an array phpstan will think the key is always set, but only if a 'child' array is set within that

Code snippet that reproduces the problem

https://phpstan.org/r/f66b9fc9-d92f-4a7e-aa1b-34483e6cf92c

Expected output

I'd expect both functions to not have any errors, but the first function has a failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions