Skip to content

Instantly share code, notes, and snippets.

@sebdesign
Created October 27, 2015 20:02
Show Gist options
  • Save sebdesign/b5e90d8f51060a0f50c8 to your computer and use it in GitHub Desktop.
Save sebdesign/b5e90d8f51060a0f50c8 to your computer and use it in GitHub Desktop.

Revisions

  1. sebdesign created this gist Oct 27, 2015.
    10 changes: 10 additions & 0 deletions curry.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <?php

    function curry(callable $function)
    {
    $args = array_slice(func_get_args(), 1);

    return function() use ($function, $args) {
    return call_user_func_array($function, array_merge($args, func_get_args()));
    };
    }