Hello internals!

Currently, iterator_count has the following signature:

 iterator_count(Traversable|array $iterator): int

If we try to use iterable type and pass it to iterator_count function, we'd
get following static analysis error:

 Argument 1 of iterator_count expects Traversable|array<array-key, mixed>,
but iterable<int, list<string>> provided (see https://psalm.dev/004)
$start(iterator_count($chunks));

>From what I know, iterable is just built-in compile time type alias
for array|Traversable
(https://www.php.net/manual/en/language.types.iterable.php)

I think it would make sense to change the signature of iterator_count to
accept iterable rather than array|Traversable so that static analysis tools
would pick it up better

Reply via email to