Файловый менеджер - Редактировать - /home/kckglobal/public_html/portal/vendor/azjezz/psl/src/Psl/Iter/reduce.php
Назад
<?php declare(strict_types=1); namespace Psl\Iter; use Closure; /** * Reduces an iterable to a single value. * * The reduction function is passed an accumulator value and the current * iterator value and returns a new accumulator. The accumulator is initialized * to $initial. * * @template T * @template Ts * * @param iterable<T> $iterable * @param (Closure(Ts, T): Ts) $function * @param Ts $initial * * @return Ts */ function reduce(iterable $iterable, Closure $function, mixed $initial): mixed { $accumulator = $initial; foreach ($iterable as $v) { $accumulator = $function($accumulator, $v); } return $accumulator; }
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка