芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/vendor/azjezz/psl/src/Psl/Vec/map.php
$i * 2); * => Vec(2, 4, 6, 8, 10) * * @template Tk * @template Tv * @template T * * @param iterable
$iterable Iterable to be mapped over * @param (Closure(Tv): T) $function * * @return ($iterable is non-empty-array ? non-empty-list
: list
) */ function map(iterable $iterable, Closure $function): array { if (is_array($iterable)) { return array_values(array_map( /** * @param Tv $v */ static fn($v) => $function($v), $iterable )); } $result = []; foreach ($iterable as $value) { $result[] = $function($value); } return $result; }