Conditions | 5 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | function array_merge_recursive_distinct(array &$array1, array &$array2) |
||
13 | { |
||
14 | $merged = $array1; |
||
15 | |||
16 | foreach ($array2 as $key => &$value) { |
||
17 | if (is_array($value) && |
||
18 | isset($merged[$key]) && |
||
19 | is_array($merged[$key]) |
||
20 | ) { |
||
21 | $merged[$key] = array_merge_recursive_distinct($merged[$key], $value); |
||
22 | } else { |
||
23 | $merged[$key] = $value; |
||
24 | } |
||
25 | } |
||
26 | |||
27 | return $merged; |
||
28 | } |
||
30 |