Anonymous Function¶
A function may be instantiated, without defining a function name. Such functions are called anonymous.
In PHP, they are defined as closures or arrow functions. They may also be created based on existing methods and functions, with the … operator.
Even without names, they are usable just like functions, or as callable.
<?php
$closure = function () {} ;
$arrowFunction = fn() => 1;
$fcs = strlen(...);
?>
See also Anonymous functions in PHP
Related : Closure, Arrow Functions, First Class Callable, Closure, Anonymous, Arrow Functions