This post originated from an RSS feed registered with PHP Buzz
by Jeff Moore.
Original Post: Closures are coming to PHP
Feed Title: Professional PHP
Feed URL: http://www.procata.com/blog/archives/category/php/feed/
Feed Description: Web Development with PHP, PHP Advocacy and Best Practices.
Dagfinn has a post looking at using the new closure feature of PHP 5.3. He compares using foreach for iteration versus array_map. “Interesting,” he concludes, “but not necessarily better than conventional alternatives.”
I agree for that case. Consider instead, a more complicated operation that requires a setup and a tear down after.
setup();
operation();
teardown();
Now what happens [...]