call_user_func_array

Supported Versions: PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
Call a callback with an array of parameters
<?php call_user_func_array(callable $callback, array $args): mixed
<?php         $result = $initial;



        foreach ($this as $key => $value) {

            $result = call_user_func_array($callback, array_merge($result, [$value, $key]));



            if (! is_array($result)) {

                throw new UnexpectedValueException(sprintf(