rfc:array_column_results_grouping
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:array_column_results_grouping [2021/11/28 12:11] – 7snovic | rfc:array_column_results_grouping [2021/12/22 09:32] – hassan | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: array_column results grouping | + | ====== PHP RFC: Add array_group function |
- | * Version: | + | * Version: |
* Date: 2021-11-28 | * Date: 2021-11-28 | ||
* Author: Hassan Ahmed, 7snovic@gmail.com | * Author: Hassan Ahmed, 7snovic@gmail.com | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | array_column ignores the duplicated rows for each similar columnt/ | + | This RFC is to implement |
===== Proposal ===== | ===== Proposal ===== | ||
- | This RFC is adding a new boolean parameter | + | This RFC is to add a new function |
- | + | <code php>array_group(array $array, int|string|null $column_key, | |
- | <code php> | + | |
- | array_column(array $array, int|string|null $column_key, | + | |
- | </ | + | |
- | + | ||
- | Or we can implement it as a new function | + | |
- | <code php>array_column_group(array $array, int|string|null $column_key, | + | |
- | + | ||
- | And keep the same parameters. | + | |
The current behavior is when you have multiple elements share the same key, it will be overwritten. | The current behavior is when you have multiple elements share the same key, it will be overwritten. | ||
Line 69: | Line 61: | ||
</ | </ | ||
- | The RFC implements a fourth parameter to array_column | + | The RFC implements a new function called array_group |
<code php> | <code php> | ||
- | print_r(array_column($array, null, ' | + | print_r(array_group($array, null, ' |
Array | Array | ||
( | ( | ||
Line 136: | Line 128: | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
Yes/No vote. | Yes/No vote. | ||
+ | |||
+ | ===== Voting ===== | ||
+ | |||
+ | Started at : 2021-12-21 | ||
+ | Ends at : 2022-01-04 | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Implementation ===== | ===== Implementation ===== | ||
- | [[https:// | + | [[https:// |
rfc/array_column_results_grouping.txt · Last modified: 2022/01/14 17:10 by cmb