Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102618 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23872 invoked from network); 5 Jul 2018 20:44:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jul 2018 20:44:49 -0000 Authentication-Results: pb1.pair.com header.from=mail@majkl578.cz; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mail@majkl578.cz; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain majkl578.cz designates 209.85.221.46 as permitted sender) X-PHP-List-Original-Sender: mail@majkl578.cz X-Host-Fingerprint: 209.85.221.46 mail-wr1-f46.google.com Received: from [209.85.221.46] ([209.85.221.46:42660] helo=mail-wr1-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/67-55607-1438E3B5 for ; Thu, 05 Jul 2018 16:44:49 -0400 Received: by mail-wr1-f46.google.com with SMTP id p1-v6so2111025wrs.9 for ; Thu, 05 Jul 2018 13:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=majkl578.cz; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zAZGyL47EBqZgTa8amAbwv7Yzg4lR0sJOjBHHbVz20o=; b=T81ll/tENYX1n90eXiw0bQSjPRxK8+OK6MqRyjfRXU25c+52kONlrlz9svbRvsTdq7 BSNng2MYEetzA+ZVD5eYXYYPZDjunyDiO8yOkbE0cQNJ9nRNuaLczpMANsTPVdzO9N/b E7JZvTdii3xE6zTGia2NfLxlnBJcjLO8hXWSU1vEStii86S7dJAwRKZnlqKqlgAlVwLW xsO0DuhGJK+2wVJMd4zmWpR/gLP7qPGRhsUD/mLoww0Gao+rL20vSN7pUnRhfPvnIJRR 5aMl9u2sFjC2B3cDw5Yb3xjrHu0Jee5MhgKZdm0b6qLHLuL/pMYmYRGwSuG1dcUXjs3u F50A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zAZGyL47EBqZgTa8amAbwv7Yzg4lR0sJOjBHHbVz20o=; b=kYbER0DcCUiy2GTzSW4z8tJfVmwnObYCwsZ/7gXEo5UjG/HoNB0iY8IlIZxIN9N2rf LPXPWxZiVWsaI+meR/G1pyDd8jYxrW8kPQtuG3tNb/sTkq2HCXX7RM5rK+ok9lKzh4EA NVk5Q46yoptPDksNQraScDWu/5xwy2H1kOAxSXqPhhx7kgIEQiASDxPopK1zHhBvVDKy Z6ryGHbP/+fMjTEjefxvVkJxjO2x2pjPcR/aE3OLVRKLXVpTdj2oUH7h6Q2+l1I9jkDH yFweHNuF1Xjaq6D/vGBeTGSql5uSZpIaIcMgE/ATqIfkZj0NQWmEubjRqjpUBVnQiQ1s 8Gug== X-Gm-Message-State: APt69E3jFGqAvfjwLBNW1C0JzWegDCWKceD6To3xGfTe+B2uILB/3zvI qeL/zpC6DBSsYd/Zg7x+k0tKss43ZTYA+CMj45d7nA== X-Google-Smtp-Source: AAOMgpeKQxrPCXCAfpSqJz+KUJ64Lj4thj/gdhoWudZuKrpk2j+TWt8EQmH0Lw0NKugoYFaoYNcai4NsFYU6JlNYLX8= X-Received: by 2002:adf:c383:: with SMTP id p3-v6mr5575579wrf.68.1530823486600; Thu, 05 Jul 2018 13:44:46 -0700 (PDT) MIME-Version: 1.0 Sender: mail@majkl578.cz Received: by 2002:a5d:570f:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 13:44:26 -0700 (PDT) X-Originating-IP: [2a00:1028:9190:d232:ad90:d725:f4c0:fa05] In-Reply-To: <00ee21cb-6a60-ea2d-c805-6ede99ff44b8@seld.be> References: <00ee21cb-6a60-ea2d-c805-6ede99ff44b8@seld.be> Date: Thu, 5 Jul 2018 22:44:26 +0200 X-Google-Sender-Auth: 9FaO0cM1zsnIVCQSAK20R6wqWj4 Message-ID: To: Jordi Boggiano Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: [RFC][Vote] iterable_to_array() and iterable_count() From: php.net@majkl578.cz (Michael Moravec) 2018-07-05 16:43 GMT+02:00 Jordi Boggiano : > Just to explain the No vote for iterable_count, I think we'd rather advocate > people implement Countable in their iterables than to force the consumption > of an iterator just to count it as this can have side-effects and render the > iterator unusable. If Countable is implemented then count() will do the job > and all is well. If consuming the iterator is desired then one still can do > count(iterable_to_array($iter)) fairly easily. Hi, I absolutely agree. I initially started writing the RFC without iterable_count(), but later I decided to include it for completeness, so that both iterator_*() functions have a proposed alternative. Of course, and for the reasons mentioned I made a vote for each of them separately. M.