Skip to content

Array created with array_combine is reported as missing keys on PHP 7.x #7469

@finwe

Description

@finwe

Bug report

Array created with array_combine is reported as missing keys on PHP 7.x as soon as I try to change some of the keys. Only the changed keys are then recognized as part of the array as seen on the code snippet below.

It doesn't matter where the values array comes from, file_get_contents in the code snippet is a pseudocode, when it comes eg from fgetcsv, same errors are being reported.

Code snippet that reproduces the problem

https://phpstan.org/r/ef9f9a4f-1cbe-425b-b2f6-c691b829bbc2

Expected output

No errors reported even on PHP 7.1-7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions