[RFC] [VOTE] Counting of non-countable objects

php.internals

Craig Duncan (PHP)

9 years ago
Hi everyone, The RFC for adding a warning when counting things that can't be counted is now in the voting phase. Voting will be open for 2 weeks and will close at 0:00 UTC on Friday 4th November. https://wiki.php.net/rfc/counting_non_countables Thanks, Craig

Dan Ackroyd

9 years ago
Hi Craig, I voted yes, but have a request. When you update the manual, please can you explicitly what is allowed, rather than just saying what is not allowed as per the RFC text. cheers Dan

Craig Duncan (PHP)

9 years ago
Hi Dan, On 23 October 2016 at 13:49, Dan Ackroyd <danack@basereality.com> wrote:
> > When you update the manual, please can you explicitly what is allowed, > rather than just saying what is not allowed as per the RFC text. > >
The manual already says what is allowed: *"Parameters: array_or_countable An array or Countable object."* Under the "Return Values" section there is sentence about the current implementation: *"If the parameter is not an array or not an object with implemented Countable interface, 1 will be returned. There is one exception, if array_or_countable is NULL, 0 will be returned."* I suggest we extend the "Return Values" section to say that a warning is raised, but I don't see any need to change the manual beyond that. Unless I have misunderstood you?

Dan Ackroyd

9 years ago
> On 25 Oct 2016, at 19:41, Craig Duncan <php@duncanc.co.uk> wrote: > > Hi Dan, > > The manual already says what is allowed: > "Parameters: array_or_countable An array or Countable object."
Thanks. There is a small possibility I missed that already being there. cheers Dan

Craig Duncan (PHP)

9 years ago
Voting has now closed and the RFC has passed with 31 votes for and 0 against. https://wiki.php.net/rfc/counting_non_countables Thanks to everybody that got involved. I've submitted a PR for the implementation: https://github.com/php/php-src/pull/2185 Thanks, Craig