Closures and Lambda Functions in PHP?!?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Closures and Lambda Functions in PHP?!?

Post 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
(#10850)
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Re: Closures and Lambda Functions in PHP?!?

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Closures and Lambda Functions in PHP?!?

Post 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.
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Re: Closures and Lambda Functions in PHP?!?

Post 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:
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Closures and Lambda Functions in PHP?!?

Post by Chris Corbyn »

Gets the thumbs up from moi! :) Anonymous object support would be even more welcome!
Post Reply