On 4 October 2016 at 11:17, Leigh <[email protected]> wrote:
> You specifically mention that counting scalars is unaffected, is there
> a legitimate use-case for being able to use count() on them?
>
> I'd say using count() on a string or an int also constitutes a hidden
> bug, as it also always returns 1 regardless of the value.
>
I agree, and I'm happy to include scalars in the RFC if that's desired by
the majority.
Calling count() on a scalar is likely to cause a warning at some point, so
it's not as "hidden" as the iterator example:
if (count($string) > 0) {
foreach ($string as $value) {