private static function cloneArray(array $source): array
    {
        $ret = [];
        foreach ($source as $key => $value) {
            if (is_array($value)) {
                $ret[$key] = self::cloneArray($value);
            } else if (is_object($value)) {
                $ret[$key] = clone $value;
            } else {
                $ret[$key] = $value;
            }
        }
        return $ret;
    }
private static function cloneArray(array $source): array
    {
        $ret = [];
        foreach ($source as $key => $value) {
            if (is_array($value)) {
                $ret[$key] = self::cloneArray($value);
            } else if (is_object($value)) {
                $ret[$key] = clone $value;
            } else {
                $ret[$key] = $value;
            }
        }
        return $ret;
    }
private static function cloneArray ( array $ source ) : array { $ ret = [ ] ; foreach ( $ source as $ key => $ value ) { if ( is_array ( $ value ) ) { $ ret [ $ key ] = self :: cloneArray ( $ value ) ; } else if ( is_object ( $ value ) ) { $ ret [ $ key ] = clone $ value ; } else { $ ret [ $ key ] = $ value ; } } return $ ret ; }
This method copies an array. All elements of the array will be cloned.

@param array $source
@return array
This method copies an array . All elements of the array will be cloned .