Re: Countable Type Hint
| From: | Craig Duncan | Date: | Thu, 17 Nov 2016 14:01:04 +0000 |
| Subject: | Re: Countable Type Hint | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96951@lists.php.net to get a copy of this message | ||
On 17 November 2016 at 13:50, Josh Di Fabio <joshdifabio@gmail.com> wrote:
> What's the benefit of such an interface? Why not simply ask for `int
> $count` in your param list instead?
>
Using the example from my original email, it's a bit awkward to always have
to pass the count of a countable:
handle_records($result, count($result));
The number of items in a countable can be established from the countable,
asking for it as a additional parameter doesn't make much sense to me