private function cloneArray(array &$array): void
    {
        foreach ($array as $key => $value) {
            if (is_object($value)) {
                $array[$key] = clone $value;
            }
            if (is_array($value)) {
                $this->cloneArray($array[$key]);
            }
        }
    }
private function cloneArray(array &$array): void
    {
        foreach ($array as $key => $value) {
            if (is_object($value)) {
                $array[$key] = clone $value;
            }
            if (is_array($value)) {
                $this->cloneArray($array[$key]);
            }
        }
    }
private function cloneArray ( array & $ array ) : void { foreach ( $ array as $ key => $ value ) { if ( is_object ( $ value ) ) { $ array [ $ key ] = clone $ value ; } if ( is_array ( $ value ) ) { $ this -> cloneArray ( $ array [ $ key ] ) ; } } }
Deep clone for arrays.

@param array $array
Deep clone for arrays .