Closures can be either anonymous or not.
Here is an anonymous closure:
$c1 = function () {};
And here is a *non* anonymous closure:
$c2 = Closure::fromCallable(['Foo', 'bar']);
ReflectionFunction::isAnonymous() returns true for $c1 and false for $c2.
Before PHP 8.2, one had to do this check to decide between both:
$r = new \ReflectionFunction($c1);
$isAnonymous = false !== strpos($r->name, '{closure}');
ReflectionFunction::isAnonymous() makes it easier to check.