We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e53b9dd commit fc80501Copy full SHA for fc80501
src/helper/ArrayMerge.php
@@ -20,9 +20,11 @@ public static function isAssoc($val) {
20
21
public static function mergeRecursive($array1, $array2)
22
{
23
- foreach($array2 as $key=>$val) {
24
- if(isset($array1[$key])) {
25
- if(self::isAssoc($val)) {
+ $array1 = (array)$array1;
+ $array2 = (array)$array2;
+ foreach ($array2 as $key => $val) {
26
+ if (isset($array1[$key])) {
27
+ if (self::isAssoc($val)) {
28
$array1[$key] = self::mergeRecursive($array1[$key], $val);
29
} else {
30
$array1[$key] = $val;
0 commit comments