call_user_func()
function call_user_func(callable $callback, ...$args): mixed
Calls a callback with the given arguments.
Parameters:
$callback(callable)...$args— variadic: collects excess arguments into$args.
Returns: mixed
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/core/call_user_func.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how call_user_func is implemented in the compiler, see the internals page.