Skip to content

Instantly share code, notes, and snippets.

@jimrubenstein
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimrubenstein/e68e4011ebd4f4850762 to your computer and use it in GitHub Desktop.
Save jimrubenstein/e68e4011ebd4f4850762 to your computer and use it in GitHub Desktop.
make a closure out of a callable
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