Skip to content

Array shape is lost on array_push with ...splat #7115

@leongersen

Description

@leongersen

Bug report

I've reported the very similar #5783 before, which was fixed (thanks!).

In 1.6.0, using array_push with the splat operator loses the array shape for the array. "regular" uses of array_push or $a[] = do not have this issue.

Code snippet that reproduces the problem

https://phpstan.org/r/35e49621-9df6-4eed-960e-e030acc9728e

Expected output

$a, $b and $c all report array<int, array{a: int, b: string}>;

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

I love working with PHPStan. I learn new things everytime!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions