Skip to content

Instantly share code, notes, and snippets.

@webbower
Created June 24, 2014 22:20
Show Gist options
  • Save webbower/4ab5ce3f3eca80e9e398 to your computer and use it in GitHub Desktop.
Save webbower/4ab5ce3f3eca80e9e398 to your computer and use it in GitHub Desktop.
Functional utility function to wrap a declared function in a passable variable for chaining (PHP 5.4+ version)
function lambdafy(callable $funcname) {
return function() use ($funcname) {
return call_user_func_array($funcname, func_get_args());
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment