-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#725Labels
Milestone
Description
Bug report
Version: 0.12.83
Whenever I use the splat operator in combination with named arguments in PHP 8 I get the following error when running phpstan.
Offset 'key' does not exist on array<int, mixed>.
Code snippet that reproduces the problem
A failing code snippet can be found here: https://phpstan.org/r/fef73ac6-edb2-4c18-bbf1-953d722e8d5f
As a reference:
<?php declare(strict_types = 1);
class HelloWorld
{
public function __construct(...$args)
{
print($args['hostname']);
}
}
$hello = new HelloWorld(hostname: 'localhost');Expected output
To be fair I'm really new to phpstan. @ondrejmirtes asked me to raise this report based on the following discussion: #4849. If I can help with some more information or details, let me know.
Reactions are currently unavailable