Page 1 of 1

Closures and Lambda Functions in PHP?!?

Posted: Wed Jul 16, 2008 1:40 pm
by Christopher
Closures and Lambda Functions appear to have been accepted (5.3 or 6.0 ? ), plus some other interesting things (__invoke() ! ):

http://wiki.php.net/rfc/closures

Which is linked from here:

http://wiki.php.net/rfc#accepted

Re: Closures and Lambda Functions in PHP?!?

Posted: Wed Jul 16, 2008 2:27 pm
by Maugrim_The_Reaper
It's all the rage to push these new things into 5.3. 5.3 is old 6.0 (minus the Unicode goodies). I remember there was lots of naysaying on these back months ago, nice to see them make it through.

Re: Closures and Lambda Functions in PHP?!?

Posted: Wed Jul 16, 2008 2:30 pm
by Eran
some more: http://dikini.net/20.06.2008/php_closur ... ctions_rfc

Definitely an exciting topic for PHP. I think anonymous functions and closures will be a very welcome addition.

Re: Closures and Lambda Functions in PHP?!?

Posted: Thu Jul 17, 2008 2:05 pm
by Mordred
In my dayjob I currently do a lot of Lua coding, and having real lambdas with a no-nonsense syntax is a real boon. Pity the designers did so much cowdung in other aspects of the language. Sensible variable scope mechanisms, namespaces and functions as first-class values are the things I miss the most in PHP.

The lambda syntax looks peachy, but the closures are ... cumbersome. Again the scope issues of PHP show their ugly face -> :dubious:

Re: Closures and Lambda Functions in PHP?!?

Posted: Sun Aug 10, 2008 9:14 pm
by Chris Corbyn
Gets the thumbs up from moi! :) Anonymous object support would be even more welcome!