Created
December 5, 2013 20:16
-
-
Save marqsm/7813089 to your computer and use it in GitHub Desktop.
Very simple compose-function in 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
// 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