Documentation

Partial
in package

Partial functions.

Tags
since
1.0

Table of Contents

Cases

PLACEHOLDER

Methods

partial()  : callable
Returns a new function, which will call the callable with the provided args and can use placeholders for runtime args.

Cases

Methods

partial()

Returns a new function, which will call the callable with the provided args and can use placeholders for runtime args.

public static partial(callable $callable, mixed ...$args) : callable

Examples:

  • `partial($fn, 1, 2)(3, 4)` = `$fn(1, 2, 3, 4)`
  • `partial($fn, 1, PLACEHOLDER, 3)(2, 4)` = `$fn(1, 2, 3, 4)`
  • `partial($fn, 1, PLACEHOLDER, 3, PLACEHOLDER, 5)(2, 4, 6)` = `$fn(1, 2, 3, 4, 5, 6)`
Parameters
$callable : callable
$args : mixed
Tags
since
1.0
Return values
callable

        
On this page

Search results