Skip to content

Instantly share code, notes, and snippets.

@bdenckla
Created October 19, 2011 23:59
Show Gist options
  • Save bdenckla/1300038 to your computer and use it in GitHub Desktop.
Save bdenckla/1300038 to your computer and use it in GitHub Desktop.
PHP function implementing partial function application
<?php
function Pa() // Partially Apply
{
$origArgs = func_get_args();
return function() use ( $origArgs )
{
$allArgs = array_merge( $origArgs, func_get_args() );
return call_user_func_array( 'call_user_func', $allArgs );
};
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment