芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/vendor/azjezz/psl/src/Psl/Async/all.php
> $awaitables * * @throws Exception\CompositeException If multiple awaitables failed at once. * * @return array
an array containing the results, preserving the original awaitables order. */ function all(iterable $awaitables): array { $values = []; // Awaitable::iterate() to throw the first error based on completion order instead of argument order foreach (Awaitable::iterate($awaitables) as $index => $awaitable) { try { $values[$index] = $awaitable->await(); } catch (Throwable $exception) { $errors = []; foreach ($awaitables as $original) { if ($original === $awaitable) { continue; } if (!$original->isComplete()) { $original->ignore(); } else { try { $original->await(); } catch (Throwable $error) { $errors[] = $error; } } } if ($errors === []) { throw $exception; } throw new Exception\CompositeException([$exception, ...$errors], 'Multiple exceptions thrown while waiting.'); } } $result = []; foreach ($awaitables as $k => $_) { $result[$k] = $values[$k]; } return $result; }