Skip to content

Instantly share code, notes, and snippets.

@luisartola
Created September 10, 2012 06:54
Show Gist options
  • Save luisartola/3689305 to your computer and use it in GitHub Desktop.
Save luisartola/3689305 to your computer and use it in GitHub Desktop.
PHP Patterns
<?php
$mapper = function($method){
return function ($class) use ($method) {
return $class->$method;
};
};
$titles = array_map ($mapper('getTitle'),$articles);
$author = array_map ($mapper('getAuthor'),$articles);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment