Re: iterator_count signature for iterables

From: Date: Tue, 26 Nov 2024 09:50:04 +0000
Subject: Re: iterator_count signature for iterables
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-126052@lists.php.net to get a copy of this message
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 tools would 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

« previous php.internals (#126052) next »