Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120473 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74648 invoked from network); 30 May 2023 17:22:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 May 2023 17:22:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 040B3180083 for ; Tue, 30 May 2023 10:22:11 -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 wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 30 May 2023 10:22:10 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id DB9B2320091C for ; Tue, 30 May 2023 13:22:09 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Tue, 30 May 2023 13:22:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type: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=fm1; t=1685467329; x= 1685553729; bh=563NejALD7WlaRUc2yUo08NxlS+buodn1shptf6ZCO4=; b=q PZzeOQj1TPjqzKALrV1Hqd/yxAvgWqkocLExL46Nt18vpKgamzCPXpOyahdK0IJG z2yX+i1Y3yczUnFb48tEQPzZUQKnG3FPsrsYryad7Nit+of2CB2WH8iGCGVLyj6M Uw0rrVkfH5b3vbhEXiFOvik4iQjRh2/0oGsNrZBT/tltS6k8trXZelbXF4rQlnBv CoLUfja0qHBV8HtoJFOttIPHxQHAY9beNdGgL5X08SYTZWvHJHMq9DyX3/L0MkGl yp0QKvX1eyJp4YcmQHo1Hoeo6T/Ia+kpcDpGZEsqtfNuaTRKYuHw9Q4ZCk+ds89t bHqbf9AV3TbxWhPhGi8rA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type: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=fm1; t=1685467329; x=1685553729; bh=563NejALD7Wla RUc2yUo08NxlS+buodn1shptf6ZCO4=; b=HC5s24si6wb3LFNgK0QJ33w3Z3Gsv VIoMr+CtB4tpnpbN9FH3oBr1/XQIZWMSmZWLoQqScFTi+mWYoRJTcs/8kMWy3lJK JP9sacH52Krdf7R9EdzyJfD7RoANGUfMrwrwbkJPO3r3NvEW0jKaf+dH1IO8i2ab XIO88AP3FiWRXy6f3tF+OzklINuQs1P2BariCFBcIWEo9zec7IoI4M+dPjg3VNvZ daYsjcn/t5HGz5r+gYbswKSLq+amwPQLIUSFjNSDpf8yBvBmdLuaO/wOsmIEvls5 loTul/ALMZ77CSORO+fYKNbZcbIvjpzuG7/zF3+yewKeVd8qIUiOb2Y6w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekjedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefofgggkfgjfhffhffv ufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoe hlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhep udeiveehffegjeefheejffegvdetveffhfekkedvteevffektddvhfekvdetvddvnecuff homhgrihhnpehgohhoghhlvgdrtghomhdpfehvgehlrdhorhhgnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlh guthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 244891700095; Tue, 30 May 2023 13:22:09 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-447-ge2460e13b3-fm-20230525.001-ge2460e13 Mime-Version: 1.0 Message-ID: In-Reply-To: References: <289E585B-EF8B-4B17-89BE-BE8295FD9FE1@gmail.com> <4CA1668E-A342-452E-A994-5839C377CB27@gmail.com> Date: Tue, 30 May 2023 17:21:42 +0000 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] [Discussion] Add new function `array_group` From: larry@garfieldtech.com ("Larry Garfield") On Tue, May 30, 2023, at 4:27 PM, Boro Sitnikovski wrote: > Hi, > > Thank you for your thoughts. > >> I would say the more common desired behavior is the one in your first >> example. And even for that we don't have a native function. > > This Google search might give more insight into the number of > discussions about a grouping functionality: > https://www.google.com/search?q=php+group+elements+site:stackoverflow.com > >> Your behavior can be implemented in userland like so: >> https://3v4l.org/epvHm > > Correct, but then again, we can also implement > `array_map`/`array_filter`/etc. in userland :) > >> I think you need to make a case as to why the behavior you describe >> justifies a native function. > > Similar to my previous answer, but also in general - ease of access and > also performance. Do you have benchmarks showing that implementing it in C would be notably faster? That would help the case that it should be written in C. Also, please do not top-post. --Larry Garfield