private static function doMapRecursive($iterable, callable $callable): array
    {
        $mapped = [];
        foreach ($iterable as $key => $value) {
            $mapped[$key] = is_iterable($value) ?
                static::doMapRecursive($value, $callable) :
                $callable($value, $key);
        }

        return $mapped;
    }
private static function doMapRecursive($iterable, callable $callable): array
    {
        $mapped = [];
        foreach ($iterable as $key => $value) {
            $mapped[$key] = is_iterable($value) ?
                static::doMapRecursive($value, $callable) :
                $callable($value, $key);
        }

        return $mapped;
    }
private static function doMapRecursive ( $ iterable , callable $ callable ) : array { $ mapped = [ ] ; foreach ( $ iterable as $ key => $ value ) { $ mapped [ $ key ] = is_iterable ( $ value ) ? static :: doMapRecursive ( $ value , $ callable ) : $ callable ( $ value , $ key ) ; } return $ mapped ; }
Internal method do actual recursion after args have been validated by main method.

@param iterable $iterable
Internal method do actual recursion after args have been validated by main method .