Skip to content

array_replace change type of array #12828

Open
@momala454

Description

@momala454

Bug report

When using array_replace on an existing array with known keys, now the existing keys are only "possible"

Code snippet that reproduces the problem

https://phpstan.org/r/70b1e175-a50d-4521-b4ce-2ffa2aac82d5

Expected output

array{abc: 'def', hello: 'country'}

Actual output

non-empty-array<'abc'|'hello', 'country'|'def'|'world'>

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions