best way to mix arrays with one same value php

I have three arrays like this :

{ 0 => ["name"=>'name1' , "value1" =>'value1'] , ...}

and I want to mix these arrays if they have the same name!

this is what i want :

{ 0 => ["name"=>'name1' , "value1" =>'value1' , "value2" =>'value2' , "value3" =>'value2'] , ...}

what I have coded : (x, y , z are my arrays)

    $m = 0;
        for ($i = 0; $i < count($x); $i++) {
            for ($j = 0; $j < count($y); $j++) {
                if($x[$i]['symbol_name'] == $y[$j]['symbol_name']){
                $chartData[$m] = array_merge($x[$i],$y[$j]);
                $m++;    
                }
            }
        }
    
    $m = 0;
    for ($i = 0; $i < count($chartData); $i++) {
        for ($j = 0; $j < count($z); $j++) {
            if ($chartData[$i]['symbol_name'] == $z[$j]['symbol_name']) {
                $newChart[$m] = array_merge($chartData[$i], $z[$j]);
                $m++;
            }
        }
    }

but as you can see this might take too long (each array has more than 600 items), so can anyone help me find the fastest way to mix these arrays.

Answer

If I right understand task:

$x = [
    ["name"=>'name1' , "value1" =>'value1'],
    ["name"=>'name2' , "value2" =>'value2'],
    ["name"=>'name3' , "value3" =>'value3'],
];

$y = [
    ["name"=>'name1' , "value11" =>'value11'],
    ["name"=>'name4' , "value4" =>'value4'],
];

$z = [
    ["name"=>'name2' , "value22" =>'value22'],
    ["name"=>'name3' , "value33" =>'value33'],
    ["name"=>'name5' , "value5" =>'value5'],
];


function mix_array(...$arrays) {
    $result = [];    
    foreach ($arrays as $array) {
        foreach ($array as $a) {
            if (!isset($result[$a['name']])) {
                $result[$a['name']] = [];
            }
            $result[$a['name']] = array_merge($result[$a['name']], $a);
        }
    }
    return array_values($result);
}   

print_r(mix_array($x, $y, $z));

Output:

Array
(
    [0] => Array
        (
            [name] => name1
            [value1] => value1
            [value11] => value11
        )

    [1] => Array
        (
            [name] => name2
            [value2] => value2
            [value22] => value22
        )

    [2] => Array
        (
            [name] => name3
            [value3] => value3
            [value33] => value33
        )

    [3] => Array
        (
            [name] => name4
            [value4] => value4
        )

    [4] => Array
        (
            [name] => name5
            [value5] => value5
        )

)