PHP does not support closures, but only pretends it does
I come from a JavaScript background where closures are a common and useful feature.
A closure is a way to contain variable scope so if there was a function thusly:
function outer() { var foo='Hello'; function inner(bar) { alert(foo+' '+bar); } inner('World'); }
then calling outer would pop up "Hello World" (closures are a lot more useful than this trivial example but lets move on)
Now PHP supports something it calls a closure. But it isn't, it's an anonymous function. While many closures are anonymous functions, and while it is useful in many cases for anonymous functions to be closures, they are not synonymous. So if you want a function that imports scope (a closure) but you want it to be a named function so that it may call itself (recursion is another very useful feature) you are shit out of luck










