Also, the function returns the correct type of Closure, as opposed to gettype()
<?php
echo get_debug_type(function () {}) . PHP_EOL;
echo get_debug_type(fn () => '') . PHP_EOL . PHP_EOL;
echo gettype(function () {}) . PHP_EOL;
echo gettype(fn () => '');
?>
Output:
Closure
Closure
object
object