News Feed
Sections




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

Lars Strojny:
Functional programming in PHP
January 17, 2013 @ 14:21:38

Lars Strojny has a new post that takes an in-depth look at the current state of functional programming in PHP:

PHP has traditionally been a simple, procedural language that took a lot of inspiration from C and Perl. Both syntax wise and making sure function signatures are as convoluted as possible. PHP 5.0 introduced a proper object model but you know all of that already. PHP 5.3 introduced closures and PHP 5.4 improved closures very much (hint: $this is available per default).

He starts by defining functional programming for those not familiar with the concept. With this understanding, he looks at what PHP has to offer that will help make this definition a reality, things like call_user_func_array and closures. He includes some code examples comparing the PHP structures to other languages and their features (like Haskell and Ruby). The post also gets a bit more practical with a "real world" example of a script that calculates the totals from the set of items in a shopping cart using a helper library to do some of the basic functional handling.

0 comments voice your opinion now!
functional programming example tutorial features functionalphp library


blog comments powered by Disqus

Similar Posts

Inside Open Source: Two New Articles (Date/Time & Services_Google)

PHPMaster.com: Extract Objects from an Access Database with PHP, Part 2

TheTechLabs.com: Integrate Flex Builder 3.0 & Php easily with the fresh ZendAMF

NetTuts.com: Refactoring Legacy Code: Part 1 - The Golden Master

Make Me Pulse Blog: Connect to Active Directory LDAP with PHP


Community Events

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


interview application introduction symfony2 example community laravel framework series install configure performance part2 php7 opinion release language podcast conference api

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