1 | <?php namespace Arcanedev\Composer\Utilities; |
||
9 | class NestedArray |
||
10 | { |
||
11 | /** |
||
12 | * Merges multiple arrays, recursively, and returns the merged array. |
||
13 | * |
||
14 | * This function is similar to PHP's array_merge_recursive() function, but it handles non-array values differently. |
||
15 | * When merging values that are not both arrays, the latter value replaces the former rather than merging with it. |
||
16 | * |
||
17 | * |
||
18 | * @param array $arrays |
||
19 | * |
||
20 | * @return array |
||
21 | * |
||
22 | * @see NestedArray::mergeDeepArray() |
||
23 | */ |
||
24 | 9 | public static function mergeDeep(...$arrays) |
|
28 | |||
29 | /** |
||
30 | * Merges multiple arrays, recursively, and returns the merged array. |
||
31 | * |
||
32 | * This function is equivalent to NestedArray::mergeDeep(), except the input arrays are passed as a single array |
||
33 | * parameter rather than a variable parameter list. |
||
34 | * |
||
35 | * @param array $arrays |
||
36 | * @param bool $preserveIntegerKeys |
||
37 | * |
||
38 | * @return array |
||
39 | * |
||
40 | * @see NestedArray::mergeDeep() |
||
41 | */ |
||
42 | 18 | public static function mergeDeepArray(array $arrays, $preserveIntegerKeys = false) |
|
66 | } |
||
67 |