News Feed
Sections




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

DZone.com:
Closure Object Binding in PHP 5.4
October 28, 2011 @ 08:43:26

In a new post to DZone.com Mitchell Pronschinske looks at closure object binding in PHP 5.4 applications (yes, we know PHP 5.4 isn't released yet). He explains what this is an shows some sample use cases for you to consider in your development.

For the people who read PHP's NEWS file, it's no surprise - but for all who don't here's is probably one of the biggest features of PHP 5.4: Closure Object Support is back. For me it's something I missed the most, when Closures were introduced in PHP 5.3. So I'm very happy, that's finally here (or back). I'm going to tell you about the rocky road which closure object binding support had and show you some simple use cases for it.

The functionality, based on this RFC, lets you more correctly bind closures to objects instead of having to pass the objects into the closure at create time. He includes an example from a Silex framework application and an example that refactors a helper method as a part of rendering a simple template.

0 comments voice your opinion now!
object binding support tutorial template example


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Create a Movie Recommendation App with Prediction.io - Setup

Zend Developer Zone: Installing PHP4 and PHP5 Concurrently on One WinXP Computer

Zend Developer Zone: Paging and Sorting Data with Zend Framework, Doctrine and PEAR (part 2)

SitePoint PHP Blog: HHVM and Hack - Can We Expect Them to Replace PHP?

Richard Lord's Blog: PHP 5.2 - Nesting level too deep - recursive dependency?


Community Events





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


library introduction symfony series voicesoftheelephpant language tool release version composer opinion community podcast update security package install framework interview laravel

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