Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99716 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54863 invoked from network); 3 Jul 2017 16:12:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2017 16:12:14 -0000 Authentication-Results: pb1.pair.com header.from=andreas@dqxtech.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=andreas@dqxtech.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dqxtech.net from 209.85.223.178 cause and error) X-PHP-List-Original-Sender: andreas@dqxtech.net X-Host-Fingerprint: 209.85.223.178 mail-io0-f178.google.com Received: from [209.85.223.178] ([209.85.223.178:36566] helo=mail-io0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/65-15131-EDC6A595 for ; Mon, 03 Jul 2017 12:12:14 -0400 Received: by mail-io0-f178.google.com with SMTP id z62so59041330ioi.3 for ; Mon, 03 Jul 2017 09:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=DwEj0t9q95GOP2/xqN3QIiKWmMgAdtTpouFTtYVZ0aQ=; b=wSxgGYHTl9KkjkvqG5uc9bLfnZQvOsbR9JdcYNurVEFDrR409HJby58u52iyB4Uble ytD+Y6EhxIo0WVRLy32ohMo4QMw0A39RVU5gvW2wQT5SRyHH+FJ7Tuz500IpwwHvZuuk 9rlipx+0dUfmhVzUZcbs2Mup6HZCJ2nAXOr4ahXXdsnMOAtLwnFVc/Nk7hZzszGoxSCk jD829ZkcGQOooAIKILc1LfRKXPDyKfcPlKCxcU9OUFOUWXRMbKpptQfUv2Z4/sjoGqt7 YPQ7eQLlJqPmF7d0J+Sm4XrJopCLjsaxPCyHVaPmSYDT48MgoL1DAKzR20Pe33uvStih TMlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=DwEj0t9q95GOP2/xqN3QIiKWmMgAdtTpouFTtYVZ0aQ=; b=qUnFng2ToSgSkqS5LZsNl332FE3qMGJgWxRkf807eUX3xKkndc35ByEz7RAV2GvqRr 8HwDJ+eFGOBKZ4Np8HLOsSKihzON9YPb3UGU3XXWNgJnu1wYZAg159aNjNnWWupuI6eB 3lwJ/03YGSRQQ5OO9B9VivAo8ZUqwKrnv8cIb/bCKUOs8ssxlvFm8J3vJplc3yQdzLXo EzI9gHFUK67dw3249tS9bgB2GlmZ9HGC/Ju077tfhfYbIOCDehBC5WMM0aH4j6VrjfgC TyzP+RhR2fJJIoMakBT6e3KYb+566RR/jsct7gr/wFBRligNuyxaU0UG+DePfkBRaaNv Vxxw== X-Gm-Message-State: AKS2vOyDsPsoo/rBR3qy/cUqUPdo/hs//PwDhH4wVuCgrrOifivPIa5G PohEE2wpP7sQOnnwRJI= X-Received: by 10.107.3.234 with SMTP id e103mr23857434ioi.136.1499098331559; Mon, 03 Jul 2017 09:12:11 -0700 (PDT) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com. [209.85.223.171]) by smtp.googlemail.com with ESMTPSA id t7sm10876920ita.1.2017.07.03.09.12.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:12:10 -0700 (PDT) Received: by mail-io0-f171.google.com with SMTP id h64so59055611iod.0 for ; Mon, 03 Jul 2017 09:12:10 -0700 (PDT) X-Received: by 10.107.154.5 with SMTP id c5mr39187261ioe.109.1499098330724; Mon, 03 Jul 2017 09:12:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.246.71 with HTTP; Mon, 3 Jul 2017 09:11:50 -0700 (PDT) In-Reply-To: References: <1499095625.19635.52.camel@schlueters.de> <1499097219.19635.57.camel@schlueters.de> Date: Mon, 3 Jul 2017 18:11:50 +0200 X-Gmail-Original-Message-ID: Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: Niklas Keller , PHP Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] "Reader" as alternative to Iterator From: andreas@dqxtech.net (Andreas Hennings) On Mon, Jul 3, 2017 at 6:08 PM, Andreas Hennings wrot= e: > On Mon, Jul 3, 2017 at 5:53 PM, Johannes Schl=C3=BCter > 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 experimen= t.