News Feed
Jobs Feed
Sections




News Archive
Sameer Borate's Blog:
Anonymous functions in PHP
June 07, 2010 @ 12:42:33

On his blog today Sameer Borate has a new post talking about anonymous functions (closures, lambdas) in PHP and includes plenty of examples of how to use them.

Anonymous functions are common in various modern languages, Ruby and Javascript being the popular one. But until version 5.3 PHP lacked true anonymous functions. Although newbie programmers are hard-pressed to find a suitable application for anonymous functions, they are indispensable if you do a lot of OOP, and can provide some elegant solutions to some particular problems.

He starts with a look at variable functions both in procedural code an object-oriented then moves to the anonymous/lambda function examples (with some nexting involved) and a few uses for closures.

0 comments voice your opinion now!
anonymous function closure lambda tutorial


blog comments powered by Disqus

Similar Posts

Developer.com: Graphing Data with PHP/SWF Charts

Ibuildings Blog: Implementing Iterators

Okaka Design Blog: Event calendar using Codeigniter and jQuery without BackendPro

DevShed: Logging in PHP Applications

Trevor Morris' Blog: fuelphp, forms and validation


Community Events











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


example release podcast database phpunit framework testing development code composer api zendframework2 opinion introduction interview series language functional community unittest

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