Determine if the new and old values for a given key are numerically equivalent.

@param string $key

@return bool
347255
protected function originalIsNumericallyEquivalent($key)
    {
        $current = $this->attributes[$key];
        $original = $this->original[$key];
        // Date comparison.
        if (in_array($key, $this->getDates())) {
            $current = $current instanceof DateTime ? $this->asDateTime($current) : $current;
            $original = $original instanceof DateTime ? $this->asDateTime($original) : $original;

            return $current == $original;
        }

        return parent::originalIsNumericallyEquivalent($key);
    }
1358067
private function removeExpired($key): bool
    {
        if (
            \array_key_exists($key, self::$expired) === false
            ||
            \array_key_exists($key, self::$values) === false
        ) {
            return false;
        }

        list($time, $ttl) = self::$expired[$key];

        if (\time() > ($time + $ttl)) {
            unset(self::$values[$key]);
        }

        if (!isset(self::$values[$key])) {
            unset(self::$expired[$key]);
        }

        return true;
    }
717547
public function isLast($key)
    {
        if (null === $this->lastKey) {
            end($this->hierarchy);
            $this->lastKey = key($this->hierarchy);
        }

        return $key === $this->lastKey;
    }
550982
public function isDirty($key = null)
    {
        return $key === null
        ? (bool) $this->dirty
        : isset($this->dirty[$key]);
    }
32555
public function offsetExists($key)
    {
        if (parent::offsetExists($key)) {
            return true;
        }

        // if it is in original and not in attributes
        // it was deleted
        if (isset($this->_originalAttributes[$key])) {
            return false;
        }

        if (!$data = $this->getFromDB($key)) {
            return false;
        }

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

        return true;

    }
531874
public function getResolvedKeyValue($key)
    {
        $keys = $this->resolvedValues;
        
        return isset($keys[$key]) ? $keys[$key] : false;
    }
494372
public function keyExists(string $key): bool
    {
        $result = $this->database->prepare('SELECT * FROM tl_db_cache WHERE cacheKey = ?')->execute($key);

        return $result->numRows > 0;
    }
287853
public function offsetExists($key)
    {
        if (is_integer($key) && $key + 1 <= $this->count()) {
            return true;
        }

        return $this->has($key);
    }
62067
public function __isset($key)
    {
        $format = $this->validateFormat($key);

        if (!$format) {
            list($op, $format) = $this->validateDiff($key);
        }

        return (bool) $format;
    }
818214
public function rm(string $key): bool {
		$filename = $this->generateFilename($key);
		return is_file($filename) && unlink($filename);
	}
752032
protected function _normalizeKey($key)
    {
        try {
            return $this->_normalizeString($key);
        } catch (InvalidArgumentException $e) {
            throw $this->_createOutOfRangeException($this->__('Invalid key'), null, $e, $key);
        }
    }
1314065
public function isExist($key = null)
	{
		return $key = is_null($key) ? false : ($this->find($key) ? true : false);
	}
1137923
public function is(string $key): bool
    {
        return isset($this->meta[$key]) && (bool)$this->meta[$key];
    }
261562
private function validateKey($key) : bool {
        if (!hash_equals($this->appKey, $key)) {
            throw new \Nuki\Exceptions\Base('Used key does not equal the known application key');
        }
        
        return true;
    }
1259685
public function has($key): bool
    {
        return ArrayUtility::dotRead($this->data, $this->getNormalizedKey($key)) !== null;
    }
901777
protected function equals($old, $new)
    {
        if (is_array($old)) {
            // compare arrays
            if (array_keys($old) != array_keys($new)) {
                return false;
            }

            foreach (array_keys($old) as $key) {
                if ( ! $this->equals($old[$key], $new[$key])) {
                    return false;
                }
            }

            return true;
        }

        if ( ! is_object($old) ) {
            // compare non-array scalars
            return ($old == $new);
        }

        if (get_class($old) != get_class($new)) {
            // compare object by class name
            return false;
        }

        // compare each sub-node
        foreach ($old->getSubNodeNames() as $property) {
            if ( ! $this->equals($old->$property, $new->$property)) {
                return false;
            }
        }

        return true;
    }
271626
protected function skipKey(string $key): bool
    {
        if (!empty($this->search)) {
            foreach ($this->search as $search) {
                if ($this->hasWildCard($search)) {
                    $search = substr($search, 0,-2);
                    if (substr($key, 0, mb_strlen($search)) === $search) {
                        return false;
                    }
                } elseif ($search === $key) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }