Skip to content

...$args unpacking is broken in PHP 8.0+ #9240

@mvorisek

Description

@mvorisek

Bug report

Phpstan claims there is an error - array key not present - since PHP 8.0, but runnable demo https://3v4l.org/1BGDs shows no difference.

I do not fully understand why phpstan behave so, so the issue title should be narrowed once the problem is better understood.

Code snippet that reproduces the problem

https://phpstan.org/r/a332d1e7-9ad5-4a70-b130-8b91cc7b7bae

Expected output

no phpstan error

the dumped type should be:

-                  array{error: int, name: string}
+array<int|string, array{error: int, name: string}>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions