Hi!
My question is not so much about implementation it is about language. I have noticed quite a few times now that PHP developers use the word "closure" when I would prefer "lambda".
Everybody on the internet knows that Wikipedia is the ultimate source of knowledge, and it says:
In computer science, a closure is a first-class function with free variables that are bound in the lexical environment. Such a function is said to be "closed over" its free variables.
I think this describes what PHP is doing.
However, in the PHP manual as well as on this list, you seem to be saying "closure" === "anonymous function" (which is what I'd rather see called lambda).
This is not entirely correct, you are right. There's a difference between anonymous function and closure, though in practice in PHP anonymous functions are closures (though some of them are rather trivial ones with no variables to "close over") and that's now the only way to do closure in PHP (i.e. you can't have non-anonymous closure function).
-- Stanislav Malyshev, Zend Software Architect s...@zend.com http://www.zend.com/ (408)253-8829 MSN: s...@zend.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php