public static function partial(callable $function, $arguments)
    {
        if (!is_array($arguments))
            $arguments = array_slice(func_get_args(), 1);

        return function () use ($function, $arguments) {
            return call_user_func_array($function, array_merge(func_get_args(), $arguments));
        };
    }
public static function partial(callable $function, $arguments)
    {
        if (!is_array($arguments))
            $arguments = array_slice(func_get_args(), 1);

        return function () use ($function, $arguments) {
            return call_user_func_array($function, array_merge(func_get_args(), $arguments));
        };
    }
public static function partial ( callable $ function , $ arguments ) { if ( ! is_array ( $ arguments ) ) $ arguments = array_slice ( func_get_args ( ) , 1 ) ; return function ( ) use ( $ function , $ arguments ) { return call_user_func_array ( $ function , array_merge ( func_get_args ( ) , $ arguments ) ) ; } ; }
Partially apply a function by filling in any number of its arguments. Not all the arguments have to be present
on the partial construction.

@category Function (uh, ahem) Functions

@param callable $function the function
@param array,mixed $arguments multiple, the arguments

@return closure
Partially apply a function by filling in any number of its arguments . Not all the arguments have to be present on the partial construction .