I have the following code:
class A
{
public static function foo(string $param)
{
return static::bar(
param2: true,
param1: static fn() => $param,
);
}
public static function bar(callable $param1, bool $param2 = false) {
// do something
}
}
Then I got the error message:
Use of unassigned variable '$param'
The error only occurs when I reverse the order of param1 and param2 in the foo function
My php version: 8.3.12
Extension version: 1.57.16971
Vscode version: 1.97.2
I have the following code:
Then I got the error message:
The error only occurs when I reverse the order of param1 and param2 in the foo function
My php version: 8.3.12
Extension version: 1.57.16971
Vscode version: 1.97.2