Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118035 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16195 invoked from network); 21 Jun 2022 12:01:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Jun 2022 12:01:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 70A31180538 for ; Tue, 21 Jun 2022 06:50:58 -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,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-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) (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 ; Tue, 21 Jun 2022 06:50:58 -0700 (PDT) Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-3178acf2a92so97601587b3.6 for ; Tue, 21 Jun 2022 06:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=WKSo0cNv8TXgPQ/kTM3hcuta9y8oJaWzzGmpxQNnpyE=; b=StNipCTx/ehGMs9xSLmxr2+ZpqI7X5tMd2Cp2YdMSZVk8VHzlOqPHHmpcw4v1YTynm Kqyp+a02RgCqTkbmK1hGJcfBDNVFhjBJq0628xgpXLSqZgabIP+bBZfovCrzVHookdFm ilzA1fHIyx7L1wRx1DkJowjCti5EhZqD0TCl8= 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:content-transfer-encoding; bh=WKSo0cNv8TXgPQ/kTM3hcuta9y8oJaWzzGmpxQNnpyE=; b=gZqXzFfwgRT9ryxdvkRMx84jvPgHhRGNkaPoDH+V+mYN5h8j8joOOSmnsuE2UZ+Dij xC3qG3I7YeYZYIN20PJrSwJNEReFatlEH+YcUHcRz5/9s3lTvtA0d2519Q/5DwUA1Sso 3a6+0YEwNCZsAx8M9tXlTTqaI+xdT5FIRyUh+gZvtKFyszJtCrsdZRcUWbfd4gKOhawa VzsWLS43hFSzv6IQo2AW1OalPEsOrXQno0YU2cNvGNVdxrnQK0chMdw2FG5zGPOKLuJC sLGg6uaO7YyfG0BldtEhtT3HCI30Ch2TmuHo/SrAWlu4HPNJI7gU0X7uG6/wQG1SXgpQ I4lQ== X-Gm-Message-State: AJIora+u/Q43hd8tnIapNHszl9U6jsX46zbLZPkFPGnH2SRTiLjscyaD GUEG/tqBNFGRqgEGD1F6+y0DIG5nZa0wo7lZJqa6yPedNBw= X-Google-Smtp-Source: AGRyM1uWkWdasQi2JmhMmdC1ROhzDw9w/JhdRI41D1Le7OEW88Fy0GYHmij/MiTUVcwa8DeZSP4KEg+6QnEXFRYYXTU= X-Received: by 2002:a81:9914:0:b0:317:6b6e:bc1e with SMTP id q20-20020a819914000000b003176b6ebc1emr31541107ywg.90.1655819457434; Tue, 21 Jun 2022 06:50:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Tue, 21 Jun 2022 07:50:46 -0600 Message-ID: To: "G. P. B." Cc: =?UTF-8?Q?Tim_D=C3=BCsterhus?= , PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Make iterator_to_array() accept all iterables From: internals@lists.php.net ("Levi Morrison via internals") On Fri, Jun 17, 2022 at 9:28 AM G. P. B. wrote: > > 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 i= t > and the change is rather minimal, if no one has any objections I think th= is > is fine to land without any RFC. Personally, I take the opposite view. This has already been declined; why should it be able to avoid the RFC process when something so similar was declined recently?