Summary of a problem or a feature request
[self::class, 'method'] is considered a valid callable, [static::class, 'method'] is not.
Code snippet that reproduces the problem
https://phpstan.org/r/ace739fe-efd0-47ef-a0c9-ef439d30d374
<?php declare(strict_types = 1);
class HelloWorld
{
public function sayHello(): void
{
echo 'Hello';
}
public function getClosure(): void
{
$closure1 = \Closure::fromCallable([self::class, 'sayHello']);
$closure2 = \Closure::fromCallable([static::class, 'sayHello']); // error
}
}
Expected output
No errors