News Feed
Sections




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

SaniSoft Blog:
Lambda functions and Closures in PHP 5.3c
October 12, 2010 @ 10:59:38

On the SaniSoft blog there's a recent post looking at one of the more recent and more powerful features to be included in PHP (as of 5.3) - lambdas and closures.

PHP 5.3 has introduced a whole new range of cool features like Namespaces, late static binding, new error levels, to name a few. But the functionality that I found most handy for day to day programming is the Lambda functions and Closures that found their way in PHP through version 5.3

The introduce the concept of the lambda/closure functions and how they can be used instead of several of the usual callback functions. In their example, they give an array of data (associative inside of a numeric key) and an array_filter call with a closure callback to check the value of the "score" value in each. Their closure example assigns the function to a variable to return the score information from the same dataset.

0 comments voice your opinion now!
closure lambda tutorial function


blog comments powered by Disqus

Similar Posts

PHPMaster.com: List Files and Directories with PHP

Community News: Zend/PHP Conference & Expo 2007 Site Posted

Jeroen van Dijk: Multi-select faceting in Solr with Solarium

SitePoint PHP Blog: Building an Ad Manager in Symfony 2

Gonzalo Ayuso: Handling several DBALs in Symfony2 through the Dependency Injection with PHP


Community Events

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


voicesoftheelephpant series threedevsandamaybe laravel5 api security interview unittest podcast release language introduction laravel community opinion version symfony extension framework library

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