Another cool thing would be binding variables to the closure during creation:
PHP Code:
function foo() {
temp.a = 2;
temp.f = function (temp.x, temp.y) use (temp.a) {
return (temp.x + temp.y) * temp.a;
};
this.bar(temp.f, 3);
}
function bar(temp.c, temp.d) {
echo(temp.c(4, temp.d)); // would echo 14
}