News Feed
Sections




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

Fabian Schmengler's Blog:
Anonymous function calls in PHP
February 25, 2011 @ 09:52:27

Fabian Schmengler has a new post today looking a using anonymous function calls in PHP. He relates to to another popular language that allows for dynamic anonymous functions - Javascript.

Anonymous function calls are a well-known pattern in JavaScript but there are also use cases in PHP where they make sense. Of course PHP 5.3 with its Lambda Functions is required!

He includes several little code snippets showing how the anonymous functions work including the "use" keyword functionality that lets you import variables from outside the function. There's a sneaky pass-by-reference in there, so don't get tripped up.

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


blog comments powered by Disqus

Similar Posts

Deepak Radhakrishnan\'s Blog: Configuring Apache - PHP - MySQL on Windows (WAMP Configuration)

Mikko Koppanen's Blog: Creating a reflection

Zend PHP Certification Blog: PHP Sorting Functions

PHPBuilder.com: Introduction to Arrays and Hashes in PHP - The ABC's of PHP Part 7

Dan Scott's Blog: Creating a MARC record from scratch in PHP using File_MARC


Community Events





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


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

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