Unset an element from an array.

@param  array  &$data
@param  string $key   Specify a nested element by separating keys with full stops.
356284
public static function forget(array &$data, $key)
	{
		$segments = explode('.', $key);

		$key = array_pop($segments);

		// iterate through all of $segments except the last one
		foreach ($segments as $segment) {
			if (!array_key_exists($segment, $data)) {
				return;
			} else if (!is_array($data[$segment])) {
				throw new \UnexpectedValueException('Non-array segment encountered');
			}

			$data =& $data[$segment];
		}

		unset($data[$key]);
	}
394056
public static function unset2D(array $data, $keys) {
	    foreach ((array)$keys as $key => $item) {
	        if (!is_array($item)) {
	            unset($data[$item]);
	            continue;
            }
            if (!isset($data[$key]) && !array_key_exists($key, $data)) {
	            continue;
            }
            if (!is_array($data[$key])) {
                unset($data[$key]);
                continue;
            }
            foreach ($item as $value) {
	            unset($data[$key][$value]);
            }
        }
        return $data;
    }
1043177
public function remove($key)
    {
        $key = strtr(strtolower($key), '_', '-');
        unset($this->_data[$key]);
        return $this;
    }
781396
public function __unsetter($key)
    {
        if (strpos($key, ".") !== false) {
            throw new \Exception('The key to unset can\'t contain a "." ');
        }

        if (isset($this->cleanData[$key])) {
            unset($this->cleanData[$key]);
        }

        if (isset($this->dirtyData[$key])) {
            unset($this->dirtyData[$key]);
        }

        $this->unsetData[$key] = 1;
    }
36710
public function setData($data, $key = null)
	{
		if (is_array($data) && $key === null) {
			$this->data = $data;

			return $this;
		}

		if ($key === null)
			$key = 'data';

		$this->data[$key] = $data;

		return $this;
	}
1370915
public function remove($criteria, $key)
    {
        if (isset($this->_data[$criteria]) &&
            is_array($this->_data[$criteria])) {
            unset($this->_data[$criteria][$key]);
            if (empty($this->_data[$criteria])) {
                unset($this->_data[$criteria]);
            }
        }
    }
367144
public function offsetUnset($key)
    {
        if (isset($this->keys[$key])) {
            unset($this->values[$key], $this->keys[$key]);
        }
    }
1097665
public function unsetData($key){

        $key = $this->normalizeKeyName($key);

        if( isset($this->_data[$key]) ){
            $this->_original[$key] = $this->_data[$key];
            $this->_changes[$key] = NULL;
            unset($this->_data[$key]);
        }

        return $this;
    }
294470
public function hmSet($key, array $data) {
        $array = ['hmset', $key];

        foreach ($data as $dataKey => $value) {
            $array[] = $dataKey;
            $array[] = $value;
        }

        return $this->send($array);
    }
49202
private function delete(array &$array, $key)
    {
        $key = trim($key, '.');
        if (strpos($key, '.') !== false) {
            $explode = explode('.', $key);
            $this->delete($array[$explode[0]], $explode[1]);
        } else {
            unset($array[$key]);
        }
    }
659210
final protected function set_data($data, $key = ''){
        if( empty($key) ){
            if( is_array($data) ){
                $this->data = array_merge($this->data, $data);
            }
        }else{
            $this->data[$key] = $data;
        }
    }
206121
protected static function removeSegments(array &$array, $key)
    {
        $parts = self::explodeDotNotationKeys($key);

        while (count($parts) > 1) {
            $part = array_shift($parts);
            if (isset($array[$part]) && is_array($array[$part])) {
                $array =& $array[$part];
            }
        }
        unset($array[array_shift($parts)]);
    }
354822
public function remove(string $key): void
    {
        if (isset($this->data[$key])) {
            unset($this->data[$key]);
            
            $this->size--;
        }
    }
70315
public function put($key, $data)
    {
        $filename = $this->getKeyCode($key);
        $data = json_encode($data);
        $this->write($data, $filename);
    }
771739
function offsetunset($key) {
		if (Base::instance()->visible($this,$key))
			unset($this->$key);
		else
			$this->clear($key);
	}
989965
public function set($key, $data)
    {
        $file = $this->getFilePath($key);

        if ($handle = fopen($file, 'w')) {
            fwrite($handle, $data);
            fclose($handle);
        }
    }
1066894
public function offsetUnset($key)
    {
        $key = $this->normalize($key);
        unset($this->bindings[$key], $this->instances[$key], $this->resoleved[$key]);
    }