array_merge_recursive

Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Merge one or more arrays recursively
<?php array_merge_recursive(array ...$arrays): array
<?php             'name' => $this->getNullableString($parentData, 'name') . $routeData['name'],

            'handler' => $routeData['handler'],

            'method' => $routeData['method'],

            'middleware' => array_merge_recursive($parentData['middleware'] ?? [], $routeData['middleware']),

            'fields' => array_merge($parentData['fields'] ?? [], $routeData['fields']),

            'parameterTypes' => array_merge_recursive($parentData['parameterTypes'] ?? [], $routeData['parameterTypes']),

        ];
<?php             'method' => $routeData['method'],

            'middleware' => array_merge_recursive($parentData['middleware'] ?? [], $routeData['middleware']),

            'fields' => array_merge($parentData['fields'] ?? [], $routeData['fields']),

            'parameterTypes' => array_merge_recursive($parentData['parameterTypes'] ?? [], $routeData['parameterTypes']),

        ];

    }