rfc:array_column_results_grouping
This is an old revision of the document!
PHP RFC: array_column results grouping
- Version: 1.0
- Date: 2021-11-28
- Author: Hassan Ahmed, 7snovic@gmail.com
- Status: Draft
- First Published at: https://wiki.php.net/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
Yes/No vote.
Implementation
rfc/array_column_results_grouping.1638099824.txt.gz · Last modified: 2021/11/28 11:43 by 7snovic