Class fn
Function utilities
To get started, place the following line around top of your code.
use amekusa\plz\fn;
Methods summary
public static
mixed
|
#
call( callable $X, mixed $Args = null, mixed $Alt = null )
Calls a function:$X
Additionally:
- If
$X is not callable, returns $Alt
- If
$X is not callable, And $Alt is callable, calls $Alt
Parameters
- $X
- A function to call
- $Args
- (optional) Arguments to pass to
$X . Pass an array for multiple parameters
- $Alt
- (optional) A fail-safe value
Returns
mixed A value $X returns or $Alt
|