-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Description
Summary of a problem or a feature request
If you pass the parameters from a constructor via ...func_get_args to the parent constructor, phpstan detects them as unused.
https://phpstan.org/r/21fbfdfe-23d4-4088-b2bf-7de5a786bc64
Code snippet that reproduces the problem
<?php declare(strict_types = 1);
class A {
private $a;
private $b;
public function __construct($a, $b)
{
$this->a = $a;
$this->b = $b;
var_dump([$this->a, $this->b]);
}
}
class B extends A {
function __construct($a, $b) {
parent::__construct(...func_get_args());
}
}
$b = new B(1, 2);
Expected output
The issue is reported incorrectly
Reactions are currently unavailable