There is the following anonymous recursive function:
$f = function($n) use (&$f) { return ($n == 1) ? 1 : $n * $f($n - 1); }; echo $f(5); // 120
I think I just found one of the legitimate (no?) uses of $GLOBALS
$GLOBALS
$f = fn ($n) =>($n == 1) ? 1 : $n * $GLOBALS['f']($n - 1); echo $f(5); // 120
Sidenote: what if $n < 1 ?
$n < 1