Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117980 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37905 invoked from network); 17 Jun 2022 13:39:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2022 13:39:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BE4901805B7 for ; Fri, 17 Jun 2022 08:28:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 17 Jun 2022 08:28:14 -0700 (PDT) Received: by mail-ed1-f52.google.com with SMTP id z7so6622829edm.13 for ; Fri, 17 Jun 2022 08:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k5iPNReRFkeIC9QqN2LOCRy5jWUgV++yyTGTcH/3J6A=; b=GxFt7hhJtZ4wgpm5emLSoVNC7+kOdZmuCAE3/m3rgJZ5p41Vi+wEkHyGgQ88lZR3HS Qm6qgwknjIjB65E5rcPk0dQvdX9d3zCQgyEemAA/mYDdaeuiMPwMxaFshVl4cYO38ETy D0r+W2+S/DeHXGgbwEj3/AetefsTjLrY8zv0zhf0HgjDuTG5Nn24gsiKSHJ9gftZTZa7 u1/Mz55v3hsw57shjJdDAicyomp6XnEi2YNYOwrT0/3M1vF72Xb09H+NHNvXYaNWG5Ui E86TRLD73/zhactCiCF7qycJaE1n6c07DnTrAW7qrlhwfxxCW3r7y/mC+5TwtlXDmeWq IiBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k5iPNReRFkeIC9QqN2LOCRy5jWUgV++yyTGTcH/3J6A=; b=jHxrpfCyy1FSTYYD05wbOaDi8hxIYXb1fHvxFy6JqeEoucjWHPOcK2SdCTJN5pajTa 3RE49HttLFN2n/CSOTl2ltk4UVlCDUSIPCg2OORLYSrtZGmnrwMPXNCwK5yqVIVs1Oi+ iC+P4ed066y1kitPGZwoSI7SW9/bcWTB8eDhF7MIlTXakLFxKO0IVfJZeexJ7tvyQP45 alXYKowDUjbMLm/KTQFu1ZcfbZ8SfKBm0fIeFnkZvarUn1Usps+A+QJYJUWbcrM366Vj HiXBMd9N1NzUHdrHHAc6tJpe4bdn99H+bJ5ZF3Pv/k86Muk0OQbxEa7fmnLhvBZOZxky o+Og== X-Gm-Message-State: AJIora98TFsniGBoPnDDaMv8xZpS3k22/e4cCO5r9UigXvwE/1OGxRA8 vaR/f49VMXDAuMyZYUgCcHzIsFzCPJLwJsBayDoD5RrfgBw= X-Google-Smtp-Source: AGRyM1sc9nHE0TGDI/UzIcTALlBTuRmDFdw7KQQCFtW2z9n/EOsInu7A8NQdr3YJOpTbRgmm0HwGLBP2m2OQRqQsIaQ= X-Received: by 2002:aa7:c54b:0:b0:42d:be18:c261 with SMTP id s11-20020aa7c54b000000b0042dbe18c261mr13065120edr.267.1655479693254; Fri, 17 Jun 2022 08:28:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jun 2022 16:28:02 +0100 Message-ID: To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000000ca4fd05e1a667af" Subject: Re: [PHP-DEV] Make iterator_to_array() accept all iterables From: george.banyard@gmail.com ("G. P. B.") --0000000000000ca4fd05e1a667af Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 17 Jun 2022 at 16:20, Tim D=C3=BCsterhus wrote: > Hi Internals > > I've come across a case where it would've been useful if > `iterator_to_array()` would accept iterable instead of Traversable to > avoid checking whether the input variable already is an array. > > To not repeat what I've already written in my proposed PR, please see: > > https://github.com/php/php-src/pull/8819 > > for more details. > > In response to my question whether this would require an RFC or whether > this is simple enough, cmb pointed to a previous RFC that proposed > *adding* a new function `iterable_to_array()` which was declined: > > https://wiki.php.net/rfc/iterable_to_array-and-iterable_count > > cmb also suggested that for this reason this topic should at least be > shortly discussed on the list, which I intend to do with this email: > > - Do you believe that my PR requires an RFC / do you want to see an RFC > for this? > - Would you object to extending 'iterator_to_array' from Traversable to > iterable (i.e. to Traversable|array)? > > Best regards > Tim D=C3=BCsterhus > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php Considering the other RFC has been declined, and I can see the value of it and the change is rather minimal, if no one has any objections I think this is fine to land without any RFC. Best regards, George P. Banyard --0000000000000ca4fd05e1a667af--