Hi Am 2024-11-26 10:40, schrieb Eugene Sidelnyk:
I think it would make sense to change the signature of iterator_count to accept iterable rather than array|Traversable so that static analysis toolswould pick it up better
That sounds like a bug in Psalm's understanding of union types. PHPStan handles it just fine: https://phpstan.org/r/8604ef1d-3500-4695-8c23-bb5d30ce4268
Best regards Tim Düsterhus