News Feed
Sections




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

Jeff Moore's Blog:
Closures (& Lambda Functions) are coming to PHP
March 23, 2009 @ 11:14:18

Jeff Moore has a new post showing an example of a feature that will be included in the upcoming PHP 5.3 release - closures/lambda functions.

Dagfinn has a post looking at using the new closure feature of PHP 5.3. He compares using foreach for iteration versus array_map. "Interesting," he concludes, "but not necessarily better than conventional alternatives." I agree for that case. Consider instead, a more complicated operation that requires a setup and a tear down after.

Jeff's example proposes that, instead of duplicating code, you use a lambda function to handle the custom parsing of the data as needed and pass that into the "doIt" function in his example.

0 comments voice your opinion now!
closure lambda example php5 setup teardown


blog comments powered by Disqus

Similar Posts

Jacob Santos' Blog: phpBB is Dead, Long Live FUDForum (or at least SMF)

Internet Super Hero Blog: Compiling mysqlnd with PHP 5.2/5.3/6.0

Alexander Netkachev's Blog: PHP IDE with debugger 0.1.6 is out

DevShed: Completing a Web Site Template using Inheritance in PHP 5

Dallas PHP User\'s Group: PHP5 Exception Handling (presentation)


Community Events

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


opinion laravel symfony2 application conference configure interview podcast example framework performance library release introduction php7 language voicesoftheelephpant community api series

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