Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102313 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33175 invoked from network); 20 Jun 2018 01:55:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2018 01:55:27 -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 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: mail@majkl578.cz X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:36628] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 99/00-32156-D04B92B5 for ; Tue, 19 Jun 2018 21:55:26 -0400 Received: by mail-wm0-f52.google.com with SMTP id v131-v6so3774666wma.1 for ; Tue, 19 Jun 2018 18:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=majkl578.cz; s=google; h=mime-version:sender:from:date:message-id:subject:to; bh=MGdpvXVQXGycEzrc4E3jVJXPAZIc0rOXM8u2dYgjfQQ=; b=eCD7X9PcOroEcf8N6Ts5o0Bowh5WgRmR6ltviFf6dlpNtenPjyopDOCY75vUx9NuVK OsnFAUfxRYs2JbF3nx0h/Fm2Lnuu9zmXkAY/HuiWmgWAcpbv7b1OunUSqnSq9CUlTna1 7Dnrb+PlfSfODvNtQFyF8UZVveRg7mw3lGML8PhprM9YxZ/4aoLeJgYRjFoRk4tjWobn a/yYegWHsi20sL9wB2JmoWIFSeeuljq585O0XR6NZPYD8RWxmF/IMvXuY65BBbnA0qhN X7XyNBnOG+cS2vvs905REI0aktvglGPYnTS+Ep+5CHOd1iCaYJ/V3Zeix33RL8RqhCgZ DyIQ== 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:from:date:message-id:subject :to; bh=MGdpvXVQXGycEzrc4E3jVJXPAZIc0rOXM8u2dYgjfQQ=; b=qivQWJ8Vm3EOfxjN60EJbHMKGo3w2NGGQorTH036e07qGOo++NwTuZ5jyyWrVSwtlH iaaHQuCEBcMWkJJTYBR36mtRt+eI2VFNvXYoSMgbnZysWDlpD0qqYNDN24LLyj7K66Ax 1N7ZI7DF20sy/ASACctc+KORW1twSHY3DfGygMomBGqgb7Nm69obqrSYj+3WZT9aoyAc qaY264n3W7gSUBZX01+sV73YH3SZtBetiwvuI75KfWTbNp9JfNNfRHFwfqepUbUuugTV W2oV2sT9z9+qywP9yPHfCuwV5+FlL1L2U/XZ0ny17xEEFDgyvHMgZwVDRNEuP/5GxL/s PfXw== X-Gm-Message-State: APt69E1ZjkpzD1unRbHC9Lv6d+sL8+JOdAt24DTnt8LdrlPtfQyECZs9 61HCdHvNw3yFmvPtPFiy7jMLOVKlo9X18cyeDpQilMq5 X-Google-Smtp-Source: ADUXVKIQOnAzkKL3vb1aOpGEe9Dtg5eD+SkQ4xOU90sCCsAIPoGcY3fbCMWP020QSZpu3dQxdQ8jEpGizShjDOhXWas= X-Received: by 2002:a1c:a54e:: with SMTP id o75-v6mr53927wme.157.1529459722789; Tue, 19 Jun 2018 18:55:22 -0700 (PDT) MIME-Version: 1.0 Sender: mail@majkl578.cz Received: by 2002:adf:f648:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 18:55:02 -0700 (PDT) X-Originating-IP: [2a02:8308:33d:7400:ac43:fb8a:8526:cd56] Date: Wed, 20 Jun 2018 03:55:02 +0200 X-Google-Sender-Auth: xJ2iFpSVGoOCQoWWV2FSyV4oF30 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000079ba9c056f091750" Subject: [RFC][Discussion] iterable_to_array() and iterable_count() From: php.net@majkl578.cz (Michael Moravec) --00000000000079ba9c056f091750 Content-Type: text/plain; charset="UTF-8" Hello internals, I'd like to propose two new functions for PHP 7.3: iterable_to_array() and iterable_count() These functions are supposed to work with iterables (7.1 pseudotype) - both arrays and iterators, unlike iterator_*() functions which only work with iterators. Here's an RFC for this: https://wiki.php.net/rfc/iterable_to_array-and-iterable_count Note that in order to make iterable_to_array() compatible with iterator_to_array(), `$use_keys = true` behavior is retained. Although this is probably not a good default value as it may cause data loss, using different default value sounds like a way worse option in terms of consistency and compatibility. A PR with implementation for iterable_to_array() is already submitted, iterable_count() to be added soon. Looking forward for your feedback. Thanks! Michael Moravec --00000000000079ba9c056f091750--