You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
array_group_by helper function does not accept array of objects #10225
Which operating systems have you tested for this bug?
Windows
Which server did you use?
cli-server (PHP built-in webserver)
Environment
production, development
Database
No response
What happened?
I have an array of objects. Each object contains a property called group. I would like to generate a multi-dimensional array where the keys are the group name and the values are an array of each object that matches that key. My code is as follows:
[TypeError]
CodeIgniter\Helpers\Array\ArrayHelper::arrayAttachIndexedValue(): Argument #2 ($row) must be of type array, stdClass given, called in C:\inetpub\wwwroot\ims\vendor\codeigniter4\framework\system\Helpers\Array\ArrayHelper.php on line 197
at SYSTEMPATH\Helpers\Array\ArrayHelper.php:209
changed the title [-]Bug: Bug: `array_group_by` helper function does not allow array of objects[/-][+]Bug: `array_group_by` helper function does not allow array of objects[/+]on May 21, 2026
changed the title [-]Bug: `array_group_by` helper function does not allow array of objects[/-][+]Bug: `array_group_by` helper function does not accept array of objects[/+]on May 21, 2026
This is not a bug. array_group_by() is designed to work with arrays of arrays, and object rows are not supported at the moment. Supporting arrays of objects would be an enhancement/feature request.
changed the title [-]Bug: `array_group_by` helper function does not accept array of objects[/-][+]`array_group_by` helper function does not accept array of objects[/+]on May 21, 2026
Activity
[-]Bug: Bug: `array_group_by` helper function does not allow array of objects[/-][+]Bug: `array_group_by` helper function does not allow array of objects[/+][-]Bug: `array_group_by` helper function does not allow array of objects[/-][+]Bug: `array_group_by` helper function does not accept array of objects[/+]michalsn commentedon May 21, 2026
This is not a bug.
array_group_by()is designed to work with arrays of arrays, and object rows are not supported at the moment. Supporting arrays of objects would be an enhancement/feature request.[-]Bug: `array_group_by` helper function does not accept array of objects[/-][+]`array_group_by` helper function does not accept array of objects[/+]refactor: scope object support to dot_array_search and array_group_by
michalsn commentedon Jun 13, 2026
Resolved via #10296