Файловый менеджер - Редактировать - /home/kckglobal/public_html/portal/vendor/azjezz/psl/src/Psl/Dict/flatten.php
Назад
<?php declare(strict_types=1); namespace Psl\Dict; /** * Returns a new dict formed by merging the iterable elements of the * given iterable. * * In the case of duplicate keys, later values will overwrite * the previous ones. * * Example: * Dict\flatten([[1, 2], [9, 8]]) * => Dict(0 => 9, 1 => 8) * * Dict\flatten([[0 => 1, 1 => 2], [2 => 9, 3 => 8]]) * => Dict(0 => 1, 1 => 2, 2 => 9, 3 => 8) * * @template Tk of array-key * @template Tv * * @param iterable<iterable<Tk, Tv>> $iterables * * @return array<Tk, Tv> */ function flatten(iterable $iterables): array { $result = []; foreach ($iterables as $iterable) { foreach ($iterable as $key => $value) { $result[$key] = $value; } } return $result; }
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка