Skip to content

array_merge() being used on looping => docs #138

@rentalhost

Description

@rentalhost

EDIT: needs to be documented here


I'm getting the reporting about using of array_merge() in loopings. My question is: what is the best way to not do that?

For instance: the code below stores some data from $user, that is an array of int.

$dupesIds = [];

foreach ($users as $user) {
    // ...
    $dupesIds = array_merge($dupesIds, $user->some_ids_array);
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions