News Feed
Sections




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

Fabien Potencier's Blog:
On PHP 5.3, Lambda Functions, and Closures
April 17, 2009 @ 10:29:43

In this new post to his blog Fabien Potencier looks at two of the much-hyped features of the upcoming PHP 5.x series release (5.3) - closures and lambda functions.

I won't talk too much about what lambda functions or closures are, as you can find many good blog posts describing them in great details. To sum up, a lambda function is an anonymous PHP function that can be stored in a variable and passed as an argument to other functions or methods. A closure is a lambda function that is aware of its surrounding context.

He includes several examples including how they would work with a few of the array functions, an implementation of the Y-combinator method (as written by Stanislav Malyshev) and how they can be used to create dependency injection functionality.

2 comments voice your opinion now!
lambda function closure php5 array ycombinator dependency injection container


blog comments powered by Disqus

Similar Posts

DevShed: Overloading and Object-Oriented Programming with PHP 5

Greg Beaver\'s Blog: subtle PHP 4 to PHP 5 difference regarding objects

WebReference.com: Access Control (in a PHP5 CMS)

Travis Swicegood: Fluent-API, here I come!

Recess Blog: Functional PHP 5.3 Part I - What are Anonymous Functions and Closures?


Community Events





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


interview series list bugfix language configure api developer laravel application threedevsandamaybe podcast community code wordpress release introduction install symfony library

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