Closure¶
Closures are anonymous functions : functions without a name. They are also supported by the eponymous Closure class in PHP.
They are close to the arrow-functions.
<?php
$closure = function ($a) use ($b) {
return $a + $b + 1;
};
?>
Related : static, Arrow Functions, Anonymous Function, First Class Callable, Callables, Callbacks, Anonymous Class, Closure Binding, Functions, Return, Sort, Use