News Feed
Sections




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

Pawel Turlejski's Blo:
What's wrong with PHP closures?
October 06, 2009 @ 13:16:18

In a recent post Pawel Turlejski takes a look at what he thinks is wrong with PHP closures as compared to syntax in a few other languages.

PHP 5.3, along with many other features, introduced closures. So now we can finally do all the cool stuff that Ruby / Groovy / Scala / any_modern_language guys can do, right? Well, we can, but we probably won't... Here's why.

He compares the PHP syntax for using closures/lambda functions with the abilities of Groovy and Scala. He does point out out that the ArrayObject wrapper does allow you to work a bit more fluently with the array's contents, but it's still not quite the same. According to him:

I'm sure closures will find their uses in the PHP world (like delayed execution or automated resource management), but IMHO replacing traditional loops and array operations is not one of them.
0 comments voice your opinion now!
closure groovy scala array example


blog comments powered by Disqus

Similar Posts

Alexey Zakhlestin's Blog: PHP+SCGI part 2: problem with eZComponents

Konr Ness' Blog: Zend_Config Benchmark - JSON, Array, INI, XML, YAML

Amazon Web Services: Introduction to AWS for PHP Developers

Etienne Kneuss' Blog: SplObjectStorage for a fast and secure object dictionary

Pawel Turlejski's Blo: What's wrong with PHP closures?


Community Events





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


introduction tips podcast laravel community release install series deployment api interview list symfony voicesoftheelephpant framework library opinion language bugfix package

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