public static function mergeDeep(array $a, array $b): array
    {
        $result = $a;
        
        foreach ($b as $k => $v) {
            if (\is_int($k)) {
                $result[] = $v;
                
                continue;
            }
            
            if (!\array_key_exists($k, $result)) {
                $result[$k] = $v;
                
                continue;
            }
            
            if (\is_array($result[$k])) {
                if (\is_array($v)) {
                    $result[$k] = self::mergeDeep($result[$k], $v);
                    
                    continue;
                }
                
                throw new \RuntimeException(\sprintf('Incompatible array merge types: %s and %s', \gettype($result[$k]), \gettype($v)));
            }
            
            if (\is_array($v)) {
                throw new \RuntimeException(\sprintf('Incompatible array merge types: %s and %s', \gettype($result[$k]), \gettype($v)));
            }
            
            $result[$k] = $v;
        }
        
        return $result;
    }