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

- Thread: https://externals.io/message/96541
- Original archive: https://news-web.php.net/php.internals/96541
- Started by Craig Duncan on 2016-10-21T15:37:56+00:00
- Messages: 5
- RFC: Counting of non-countable objects (Implemented (PHP 7.2)) — https://externals.io/rfc/counting_non_countables.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #96541 — Craig Duncan — 2016-10-21T15:37:56+00:00

URL: https://externals.io/message/96541#96541

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

---

## #96558 — Dan Ackroyd — 2016-10-23T12:49:52+00:00

URL: https://externals.io/message/96541#96558 · In reply to: #96541

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

---

## #96610 — Craig Duncan — 2016-10-25T18:41:56+00:00

URL: https://externals.io/message/96541#96610 · In reply to: #96558

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?

---

## #96612 — Dan Ackroyd — 2016-10-26T11:07:02+00:00

URL: https://externals.io/message/96541#96612 · In reply to: #96610

> 
> 
> 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

---

## #96734 — Craig Duncan — 2016-11-05T11:37:30+00:00

URL: https://externals.io/message/96541#96734 · In reply to: #96541

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
