*/ class ArrayUtils { /** * Flatten and iterate * * @param array $array * @param string $delimiter * @param string $basePath * @return Generator|mixed[] */ public static function flattenAndIterate(array $array, string $delimiter = '.', string $basePath = ''): Generator { foreach ($array as $key => $value) { $fullKey = implode($delimiter, array_filter([$basePath, $key])); if (is_array($value)) { yield from static::flattenAndIterate($value, $delimiter, $fullKey); } else { yield $fullKey => $value; } } } /** * Merge configuration arrays * * What I would wish that array_merge_recursive actually does. * * This is a cascading merge, with individual values being overwritten. * From: http://www.php.net/manual/en/function.array-merge-recursive.php#102379 * * @param array $arr1 Array #1 * @param array $arr2 Array #2 * @return array */ public static function merge(array $arr1, array $arr2): array { foreach ($arr2 as $key => $value) { if (array_key_exists($key, $arr1) && is_array($value) && is_array($arr1[$key])) { $arr1[$key] = static::merge($arr1[$key], $arr2[$key]); } else { $arr1[$key] = $value; } } return $arr1; } } __halt_compiler();----SIGNATURE:----ow6o4EkUKLNwlgWOCCo30vx8In3x+nksw128UBHotO+th/CYD+Emz72V+rI7LStgOCCAs83WpG7FVJcDOrOd9KD7YSFsjsRxNuFw2jDCvgPQ/c1SrgdRc+hTPpCqJjCRfXLsq98eady0JTD881qs33ybGqoOZHhpuiX6IgQvVagw107+U6MGq8gpWHpaTPQxUPjPgUcCmKNB44/9F4HGQgoBpYMYx6+/wDalUvKIvVWe62+Okd5sGatzJke947IJ3fvao0zjZSW8UM7RH6munfXhDfSN2ewWXGEvJ/jCtN2HhqjKNvOTJv3obR2tS4ebitczbDa5vzms/+5N3QYqI1gWWxQDglHLPYH08M7RVnnADr/UNdSRMurqkJ7HWtjnDjTR7eRep1gfTlngg3L2PLcV8anMiWygmSDq1bCartcwA4AIzvuPLcu2Ubtfi9BRmhFMW885Ld9lN5n9LaXeTxBypNOoIoauuf9qmNaXg6C4XreOvk9eO7SJOyjmxpAc1mcXrCeYKfLhUQgZf73KFTeoX70Qq1ajKqx/BzG6ZxZE5WD0+SlHYGXMmnXhYjnQzdZigcthueRXIQdzw42dpw31VRrv3tJexelbowLQQ3bx4IOniWpidzQ4x8rgNzV5wEtVq3z8jtObNMb8oeQE2ydf2H3As8GSJhm79GOmKko=----ATTACHMENT:----MzY1NjE5MTcwNTQ5NjcwIDM0OTI4MTI3OTE2NzM2OTAgMjU1NjQxMzg0NzY2NjIxOA==