[RFC] Counting of non-countable objects
| From: | Craig Duncan | Date: | Tue, 04 Oct 2016 09:32:34 +0000 |
| Subject: | [RFC] Counting of non-countable objects | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-96211@lists.php.net to get a copy of this message | ||
Hi everybody
I'd like to propose the introduction of warning when counting objects that
can't be counted.
The default behaviour is to return 1 for these objects, which can be
misleading and hide bugs when attempting to count iterable objects (eg
Generators). Adding a warning would alert developers to the issue
https://wiki.php.net/rfc/counting_non_countables
Thanks,
Craig