News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Timothy Boronczyk's Blog:
Anonymous Functions and Closures
March 10, 2009 @ 12:57:08

Timothy Boronczyk has written up a new blog post about two of the features he's most excited about in the upcoming PHP 5.3 release - anonymous functions and closures.

As of version 5.3, PHP will offer better support for anonymous functions and a new syntax which supports closures. [...] Anonymous functions are functions that are defined without being bound to a proper name. Typically, anonymous functions are used only a limited number of times and for a specific purpose; you could think of them as "throw-away" functions if you'd like.

He includes some code examples showing how the anonymous functions can replace the current create_function method and how closures can effectively import variable values into the current scope just like they were passed in.

0 comments voice your opinion now!
php5 closure anonymous function example


blog comments powered by Disqus

Similar Posts

Ilia Alshanetsky's Blog: 5.2.4 RC1 Released

Hasin Hayder's Blog: Counting occurrence of a word in a String - Benchmarking of PHP functions

PHPEasy.co.uk: Tutorial: Type Hinting in PHP

Mike Naberezny's Blog: Easier XML-RPC for PHP 5

PHPKitchen: Using the latest PHP 5 and AJAX technology


Community Events





Don't see your event here?
Let us know!


code unittest podcast community framework language install developer introduction threedevsandamaybe testing series interview opinion experience configure laravel release refactor list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework