Last active
August 29, 2015 14:17
-
-
Save ihabunek/ec715448fb86813d3917 to your computer and use it in GitHub Desktop.
How functional programming affected my use of PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before FP | |
$listings = []; | |
foreach ($docs as $item) { | |
$listings[] = Listing::fromSolr($item); | |
} | |
// After FP | |
$listings = array_map([Listing::class, 'fromSolr'], $docs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment