rfc:array_column_results_grouping

This is an old revision of the document!


PHP RFC: array_column results grouping

Introduction

array_column ignores the duplicated rows for each similar columnt/index.

Proposal

This RFC is adding a new boolean parameter to array_column to determine it's behaviour of grouping or not.

array_column(array $array, int|string|null $column_key, int|string|null $index_key = null, $grouping = null): array

Or we can implement it as a new function with something like

array_column_group(array $array, int|string|null $column_key, int|string|null $index_key = null)

And keep the same parameters.

Backward Incompatible Changes

No backward incompatible breaks.

Proposed PHP Version(s)

Next PHP 8.x, currently PHP 8.2.

RFC Impact

To Existing Extensions

Standard ext

Proposed Voting Choices

Include these so readers know where you are heading and can discuss the proposed voting options.

Implementation

rfc/array_column_results_grouping.1638099489.txt.gz · Last modified: 2021/11/28 11:38 by 7snovic