On Thu, Nov 17, 2016 at 2:01 PM Craig Duncan <p...@duncanc.co.uk> wrote:
> On 17 November 2016 at 13:50, Josh Di Fabio <joshdifa...@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 > > Apologies, I thought you were simply proposing the following: interface Countable { function count(): int; } But you're actually proposing the following as well? interface Arraylike extends Iterator, Countable { } I can see the use of an interface which combines Iterator and Countable, but not Countable on its own.