class Run (View source)

This trait provides static method to dynamically call any function, method, or instance.

Methods:

  • call(mixed $callable, mixed ...$args): mixed: Calls a function, method, or instance dynamically.
  • callArray(mixed $callable, array $args = []): mixed: Calls a function or method with an array of arguments.

Methods

static mixed
call(mixed $callable, mixed ...$args)

Static method to dynamically call any function, method, or instance.

static mixed
callArray(mixed $callable, array $args = [])

Static method to call a function or method with an array of arguments.

Details

static mixed call(mixed $callable, mixed ...$args)

Static method to dynamically call any function, method, or instance.

Parameters

mixed $callable

string or (global function) or array [class, method], [object, method] or closure.

mixed ...$args

arguments to send to the callable

Return Value

mixed

return the result of the call

static mixed callArray(mixed $callable, array $args = [])

Static method to call a function or method with an array of arguments.

Parameters

mixed $callable

string or (global function) or array [class, method], [object, method] or closure.

array $args

arguments to send to the callable

Return Value

mixed

return the result of the call