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
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
Hi Dan,
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?
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
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