Last active
August 29, 2015 14:16
-
-
Save jimrubenstein/e68e4011ebd4f4850762 to your computer and use it in GitHub Desktop.
make a closure out of a callable
This file contains hidden or 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
function closureify(callable $fn) | |
{ | |
return function() use ($fn) { | |
return call_user_func_array($fn, func_get_args()); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment