On Mon, Jul 3, 2017 at 6:08 PM, Andreas Hennings <andr...@dqxtech.net> wrote:
> On Mon, Jul 3, 2017 at 5:53 PM, Johannes Schlüter
> <johan...@schlueters.de> wrote:
>> On Mo, 2017-07-03 at 17:32 +0200, Niklas Keller wrote:
>>
>>> > That distinction is the reason why next() and valid() are different
>>> > methods in iterators.
>
> I would rather say this is the reason why current() and valid() are
> different methods.
> A combination of ->current() and next() would not cause problems.
>
>>>
>>> Not really, Iterator::next() returns void, so could as well return
>>> bool.

Just so we are on the same page:
Changing the behavior of Iterator interface would be a BC break.
Introducing a new interface, and letting Generator implement it, would
not break anything.
(except for the possible nameclash, if the an interface with the same
name already exists in userland outside of a namespace)

I assume we already agree on this, and this was more of a thought experiment.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to