Skip to content

Instantly share code, notes, and snippets.

@marqsm
Created December 5, 2013 20:16
Show Gist options
  • Save marqsm/7813089 to your computer and use it in GitHub Desktop.
Save marqsm/7813089 to your computer and use it in GitHub Desktop.
Very simple compose-function in PHP
// Can manage multiple argumets for function, but can compose only 2 functions...
function compose($a, $b) {
return function() use ($a, $b) {
return $a(call_user_func_array($b, func_get_args()));
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment