PHP's Closure is an anonymous function. It was introduced by PHP5.3.
The syntax of closures is very simple. The only key word to be noticed is use, which means to connect closures and external variables.
such as Manual http://php.net/manual/en/functions.anonymous.php Example Cart in
Here, if we modify the getTotal function, we must use foreach
Note that the use in the above question uses &, and if it is not used here & there will be an error fib(fib(n-1) cannot find the function (the type of fib has not been defined previously)
So when you want to use a closure unwinding function, you need to use the
In this form
If you need to delay binding variables in use, you need to use references, otherwise you will make a copy of the definition and put it in use
Using and not using references means whether to assign when calling or when declaring