src/Cloudinary.php
public static function array_copy($array)
    {
        if (!is_array($array)) {
            return $array;
        }

        $result = array();
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                $result[$key] = self::array_copy($val);
            } elseif (is_object($val)) {
                $result[$key] = clone $val;
            } else {
                $result[$key] = $val;
            }
        }
        return $result;
    }
public static function array_copy($array)
    {
        if (!is_array($array)) {
            return $array;
        }

        $result = array();
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                $result[$key] = self::array_copy($val);
            } elseif (is_object($val)) {
                $result[$key] = clone $val;
            } else {
                $result[$key] = $val;
            }
        }
        return $result;
    }
public static function array_copy ( $ array ) { if ( ! is_array ( $ array ) ) { return $ array ; } $ result = array ( ) ; foreach ( $ array as $ key => $ val ) { if ( is_array ( $ val ) ) { $ result [ $ key ] = self :: array_copy ( $ val ) ; } elseif ( is_object ( $ val ) ) { $ result [ $ key ] = clone $ val ; } else { $ result [ $ key ] = $ val ; } } return $ result ; }
Helper function for making a recursive array copy while cloning objects on the way.

@param array $array Source array

@return array Recursive copy of the source array
Helper function for making a recursive array copy while cloning objects on the way .