Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116577 Return-Path: <7snovic@gmail.com> Delivered-To: mailing list internals@lists.php.net Received: (qmail 92393 invoked from network); 6 Dec 2021 18:37:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Dec 2021 18:37:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 15F3218037F for ; Mon, 6 Dec 2021 11:37:41 -0800 (PST) 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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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: <7snovic@gmail.com> Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 6 Dec 2021 11:37:40 -0800 (PST) Received: by mail-io1-f42.google.com with SMTP id x10so14264810ioj.9 for ; Mon, 06 Dec 2021 11:37:40 -0800 (PST) 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:content-transfer-encoding; bh=0yOf7G5x1LFwSh26MK9FMkgeOxYdWrDEAR19ra84dNI=; b=SNyDajZGAqFa5Vs6dp5KxrQ7DiF4QIN+MK4HSpL2l3ZxipPSE7TI3PcOHH29D+iPxj Ws8usWuteKyAAbu9RCuaTkYz6rQJ3DokZt+lblVvO3zIgT8HxIgCR4K+XQtQeU6q1gcb dBymisJayELsXpsxrttLLfwLNLGBxMANiP5tgnfJbKEQDiHatfwpK0V1ROUeYAF3z4V2 34w2WiDSQdSK4WisXJWBSmV8KS0Wth6OyoEQRofpRQNvkxsxmb0pT2trCm/957hjEJ0W 3pWaVuh4zybeRGOBeZsTLqzyayZgugqexxiNhQ3cUbJUNPjs04rZO/fGGxg/TzLdMIZL hTnw== 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=0yOf7G5x1LFwSh26MK9FMkgeOxYdWrDEAR19ra84dNI=; b=3Wt+F3ovZkFzG6dGivy3eRrLdM3142EzeA/72EzFUZukQBtS+mQmRTYCWlPzqunrY2 Ed0l2eZOBVgwtNGVViha/UupFm4+gDnkUdpru3W/dBzmAW8XQtIfalTPz2XjiBGR2nAT APKraj/FLi3okp12IPdGQX5tgyxYozSvs5HaEO3uY0k4LKxthHsCiFHOnaIhOyX2nImd DSFnygVwIZ4SqU3DssGwlGcvT+msfBxCFUhFxMUvdwko054dQ2bp2czuo1DvDHUrkDM9 KWCD5mENgnlus6IbaNYiweg6XOhrku/Tfsn+uZ1YOkIMnb1K3dKvdzKqObfFihoSuIE1 vI+g== X-Gm-Message-State: AOAM53229Z7tGyXbLKgd2vemTfIcVB0+1RVWt1tJFb3VzFdUtfmdSGMF KIcbPkHbz2VPsoqFFZw2Dz2evV6JFmhA7f/Bg1LdyLbUw6+zXg== X-Google-Smtp-Source: ABdhPJwKWxEMQc/l/qCcDlfm/J2t2kUlkCbaSqrh9/iSbb4uZBWRGzTrfyHkKWstAN3nIbVL1/QDI+ziC/UxkovPIns= X-Received: by 2002:a6b:7a0c:: with SMTP id h12mr1914468iom.176.1638819459926; Mon, 06 Dec 2021 11:37:39 -0800 (PST) MIME-Version: 1.0 References: <61ac9759.1c69fb81.b0241.1e6fSMTPIN_ADDED_MISSING@mx.google.com> <268F5B4F-4770-48AA-B212-DE23116BCF4C@gmail.com> In-Reply-To: <268F5B4F-4770-48AA-B212-DE23116BCF4C@gmail.com> Date: Mon, 6 Dec 2021 21:37:28 +0200 Message-ID: To: Claude Pache Cc: Rowan Tommins , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC [Discussion] array_column results grouping From: 7snovic@gmail.com (Hassan Ahmed) The named arguments are a great thing to set in mind, but I think that we will go to complicate it with optional arguments. there is a comment on the PR that asks for another option to preserve the sub-array index to be the new array index. also with the comments by `Hendra Gunawan` in mind. adding a new optional argument will make it harder to expand it in the future. Hassan Ahmed On Mon, Dec 6, 2021 at 12:24 PM Claude Pache wrote= : > > > > Le 6 d=C3=A9c. 2021 =C3=A0 09:44, Hassan Ahmed <7snovic@gmail.com> a =C3= =A9crit : > > Hello Folks, Thanks a lot for your feedback, as already mentioned in > the RFC and as mentioned by Rowan too a new function is an option. I > think that mostly we will go with the new function option. > I will try to edit the PR to add a new function, does there any > suggestions/naming conventions for the new function? a colleague > suggested being `array_group_by` and Hendra already suggested to be > `array_column_group` which is good too. > > Regards, > Hassan > > > > Now that we have named arguments, the issue of long and complicated list = of arguments is considerably weaken, since you can write: > > array_column($foo, column_key: 'name', grouping: true); > > in lieu of: > > array_column($foo, null, 'name', true) > > Also, an alternative to a new function, is reusing the same function with= an alternative signature, as it was done for setcookie: > > https://www.php.net/manual/fr/function.setcookie.php > > I have no opinion about which of the three approaches (new parameter, sam= e function with alternative signature, new function) is better; I just ment= ion the various alternatives. > > =E2=80=94Claude