diff --git a/SPL/SPL_f.php b/SPL/SPL_f.php index 0897e843b..f306e966b 100644 --- a/SPL/SPL_f.php +++ b/SPL/SPL_f.php @@ -139,15 +139,19 @@ function spl_object_hash(object $object): string {} /** * Copy the iterator into an array * @link https://php.net/manual/en/function.iterator-to-array.php - * @template TKey + * @template TKey of int|string * @template TValue - * @param Traversable $iterator

+ * @param Traversable|array $iterator

* The iterator being copied. *

* @param bool $preserve_keys [optional]

* Whether to use the iterator element keys as index. *

- * @return array|TValue[] An array containing the elements of the iterator. + * @return ( + * $preserve_keys is true ? array : ( + * $preserve_keys is false ? TValue[] : + * array|TValue[]) + * ) An array containing the elements of the iterator. */ function iterator_to_array(#[LanguageLevelTypeAware(['8.2' => 'Traversable|array'], default: 'Traversable')] $iterator, bool $preserve_keys = true): array {}