Grouping array_column results

  116535
November 28, 2021 08:16 7snovic@gmail.com (Hassan Ahmed)
Hello,
I started to edit the array_column function to accept the fourth
parameter to group the similar results


The current behavior is when you have multiple elements share the same
key, it will be overwritten.
let's assume that we have the following.
```
 1, 'name' => 'hassan'],
    ['id' => 2, 'name' => 'sara'],
    ['id' => 3, 'name' => 'selim'],
    ['id' => 4, 'name' => 'chris'],
    ['id' => 5, 'name' => 'sara'],
];
```

when we use array_column with this the output will be
```
print_r(array_column($array, null, 'name'));
Array
(
    [hassan] => Array
        (
            [id] => 1
            [name] => hassan
        )

    [sara] => Array
        (
            [id] => 5
            [name] => sara
        )

    [selim] => Array
        (
            [id] => 3
            [name] => selim
        )

    [chris] => Array
        (
            [id] => 4
            [name] => chris
        )

)
```

I'd added a fourth parameter to array_column to group the results in
an indexed array to group all the similar elements, so we can use :

```
print_r(array_column($array, null, 'name', true));
Array
(
    [hassan] => Array
        (
            [0] => Array
                (
                    [id] => 1
                    [name] => hassan
                )

        )

    [sara] => Array
        (
            [0] => Array
                (
                    [id] => 2
                    [name] => sara
                )

            [1] => Array
                (
                    [id] => 5
                    [name] => sara
                )

        )

    [selim] => Array
        (
            [0] => Array
                (
                    [id] => 3
                    [name] => selim
                )

        )

    [chris] => Array
        (
            [0] => Array
                (
                    [id] => 4
                    [name] => chris
                )

        )

)
```

not sure if we need to implement this as a new function
`array_column_group` or we can keep the fourth optional parameter.

however, I have an issue in creating an account on the wiki so I can
not create an RFC.

it keeps giving me this error `That wasn't the answer we were
expecting` no matter the email/user name I use

PR number: https://github.com/php/php-src/pull/7698
  116536
November 28, 2021 10:46 cmbecker69@gmx.de ("Christoph M. Becker")
On 28.11.2021 at 09:16, Hassan Ahmed wrote:

> however, I have an issue in creating an account on the wiki so I can > not create an RFC. > > it keeps giving me this error `That wasn't the answer we were > expecting` no matter the email/user name I use
You need to enter the address of this mailing list in the last input field. :) -- Christoph M. Becker
  116537
November 28, 2021 11:06 7snovic@gmail.com (Hassan Ahmed)
Hello Christoph, Thanks for your reply, I already created the account
and now waiting for the account confirmation. Thanks a lot.

On Sun, Nov 28, 2021 at 12:46 PM Christoph M. Becker <cmbecker69@gmx.de> wrote:
> > On 28.11.2021 at 09:16, Hassan Ahmed wrote: > > > however, I have an issue in creating an account on the wiki so I can > > not create an RFC. > > > > it keeps giving me this error `That wasn't the answer we were > > expecting` no matter the email/user name I use > > You need to enter the address of this mailing list in the last input > field. :) > > -- > Christoph M. Becker
  116538
November 28, 2021 11:18 cmbecker69@gmx.de ("Christoph M. Becker")
On 28.11.2021 at 12:06, Hassan Ahmed wrote:

> Hello Christoph, Thanks for your reply, I already created the account > and now waiting for the account confirmation. Thanks a lot.
RFC karma granted. Best of luck! :) Christoph
  116539
November 28, 2021 11:38 7snovic@gmail.com (Hassan Ahmed)
Thanks a lot for your support.

On Sun, Nov 28, 2021 at 1:18 PM Christoph M. Becker <cmbecker69@gmx.de> wrote:
> > On 28.11.2021 at 12:06, Hassan Ahmed wrote: > > > Hello Christoph, Thanks for your reply, I already created the account > > and now waiting for the account confirmation. Thanks a lot. > > RFC karma granted. Best of luck! :) > > Christoph
  116540
November 28, 2021 12:21 7snovic@gmail.com (Hassan Ahmed)
Hello Christoph, does there any way to update my username from
`7snovic` to `hassan` ?

On Sun, Nov 28, 2021 at 1:38 PM Hassan Ahmed <7snovic@gmail.com> wrote:
> > Thanks a lot for your support. > > On Sun, Nov 28, 2021 at 1:18 PM Christoph M. Becker <cmbecker69@gmx.de> wrote: > > > > On 28.11.2021 at 12:06, Hassan Ahmed wrote: > > > > > Hello Christoph, Thanks for your reply, I already created the account > > > and now waiting for the account confirmation. Thanks a lot. > > > > RFC karma granted. Best of luck! :) > > > > Christoph
  116541
November 28, 2021 12:27 cmbecker69@gmx.de ("Christoph M. Becker")
On 28.11.2021 at 13:21, Hassan Ahmed wrote:

> Hello Christoph, does there any way to update my username from > `7snovic` to `hassan` ?
Done. Also, please note that top posting is frowned upon on the PHP mailing lists, see <https://github.com/php/php-src/blob/master/docs/mailinglist-rules.md>. :) Christoph