Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117981 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40778 invoked from network); 17 Jun 2022 13:58:48 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2022 13:58:48 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 21564180545 for ; Fri, 17 Jun 2022 08:47:03 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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:47:02 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 158D532009BF for ; Fri, 17 Jun 2022 11:47:00 -0400 (EDT) Received: from imap52 ([10.202.2.102]) by compute1.internal (MEProxy); Fri, 17 Jun 2022 11:47:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to; s=fm2; t=1655480820; x=1655567220; bh=iyZtBlS/dKabej4XAZ/S21pUJ fNyRQa/u0Y6t6KnB+Q=; b=BAJ4xvKfY35ByGDh7FkqEPhGVGS2Pz6rYNOmiy75e cyr/Ygq+27dekrm9TkzG1/oVjH2Ps1DDaNUEkG7LfwRvgFZ/t248G2f0+gijDqzD pYLwEoxiNcA2mRWjz431VlTv0x1hg0aIGtli1KaW9Lv9Gq9VDn5N37zT1QKMicTR 518yIfmeI9dCSPn4mKShLqB3XVNcGc5qhM/WJaF+fnDuEpDklVHtRZioHlAxaDdu SF/26++4qn9hMEVis9n5Hh2hkfinlgkMZT1Le8rfySjP8tSYGMsgjDta8YYb3GW6 2eGAPSlufFjVcHChjdBildhUjZxt/FU7ZnqRAShQGXYTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1655480820; x=1655567220; bh=i yZtBlS/dKabej4XAZ/S21pUJfNyRQa/u0Y6t6KnB+Q=; b=Zg+XFv1w2MAnS9h+N FcoeS9d4fWhoC7j86rGHdUZVcaYKZ8rvTun31evYR2RvuGi75u5IPnOG1ao/nMs0 MpFp9PxMR/qvaaxPzP5nIz1/wR535q/PVbQemsO15FCdflJ1fMxnsJA7L1VgQE0M /8kQ5bV9E9GmFsbo3GyXFwJMe0a5FSiizsDUUPX2K2fOT/Ka7KgD1gESCja18avO L3hNSfeYaTyvC8Iot2fybhY760/2+q2BrC/6M4/J+OdcLqnslyJf89Ij47crLSt4 h2nVYcFE0X2QP2LkcDa/4rpGEYfZ3VARkTa+WlgP0wAf95NbbN5Bdlt0mgjTS08T 02c9A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddvhedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepvefhgedvgedufefhleefueelvedtvdeivefhgfev heetiedvhfdufffgiedtieeknecuffhomhgrihhnpehgihhthhhusgdrtghomhdpphhhph drnhgvthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4B47BC6008B; Fri, 17 Jun 2022 11:47:00 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-712-gb9e94258b0-fm-20220610.001-gb9e94258 Mime-Version: 1.0 Message-ID: <0f799483-a176-4b25-a81c-5eb6e9b529c1@www.fastmail.com> In-Reply-To: References: Date: Fri, 17 Jun 2022 10:46:40 -0500 To: "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: larry@garfieldtech.com ("Larry Garfield") On Fri, Jun 17, 2022, at 10:20 AM, Tim D=C3=BCsterhus wrote: > Hi Internals > > I've come across a case where it would've been useful if=20 > `iterator_to_array()` would accept iterable instead of Traversable to=20 > 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 whethe= r=20 > this is simple enough, cmb pointed to a previous RFC that proposed=20 > *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=20 > 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 RF= C=20 > for this? > - Would you object to extending 'iterator_to_array' from Traversable t= o=20 > iterable (i.e. to Traversable|array)? I support this; my only wrinkle would be that it's still a long name com= pared to what many languages have for this functionality, but I suppose = that ship has long since sailed. :-) Since it's a strictly type-widening change with no BC implications I can= think of, I am impartial on RFC or not. If it's going to get an RFC, t= hough, that needs to be posted, like, immediately if it's going to get i= nto 8.2. --Larry Garfield