Determines whether an item is present in the cache and life time expired.

@param string $key The unique cache key of the item to check for expiring.

@return bool True if the item was expired. False if not.
973978
public function expired(string $key): bool
    {
        try {
            return $this->storage->expired($key);
        } catch (BadPacketException $e) {
            return true;
        }
    }
1085407
public function isCached($key) {
        // The actual working horse. The method does not only check existence of the key. It retrieves the value and stores
        // it in the local reference pool, so following cache queries can use the local reference.

        // check local reference pool
        if ($this->getReferencePool()->isCached($key))
            return true;

        // query APC cache
        $data = apc_fetch($this->namespace.'::'.$key);
        if (!$data)                                     // cache miss
            return false;

        // cache hit
        $created = $data[0];                            // data: [created, expires, serialized([$value, $dependency])]
        $expires = $data[1];

        // check expiration
        if ($expires && $created+$expires < time()) {
            $this->drop($key);
            return false;
        }

        // unpack serialized value
        $data[2]    = unserialize($data[2]);
        $value      = $data[2][0];
        $dependency = $data[2][1];

        // check dependency
        if ($dependency) {
            $minValid = $dependency->getMinValidity();

            if ($minValid) {
                if (time() > $created+$minValid) {
                    if (!$dependency->isValid()) {
                        $this->drop($key);
                        return false;
                    }
                    // reset the creation time by writing back to the cache (resets $minValid period)
                    return $this->set($key, $value, $expires, $dependency);
                }
            }
            elseif (!$dependency->isValid()) {
                $this->drop($key);
                return false;
            }
        }

        // store the validated value in the local reference pool
        $this->getReferencePool()->set($key, $value, Cache::EXPIRES_NEVER, $dependency);
        return true;
    }
1239417
public function has($key)
    {
        if (!$this->isEnabled()) {
            return false;
        }

        return (false !== apc_fetch($this->prefix() . $key));
    }
818496
public function has($key)
    {
        // Got help from here: http://stackoverflow.com/a/3091136/1208233
        if (!$this->memcached->add($key, true, 10)) {
            // If not possible to add, then the key exists
            return true;
        } else {
            // If possible to add, then the key doesn't exist
            $this->memcached->delete($key);
            return false;
        }
    }
1222616
public function containsKey($key): bool
    {
        return isset($this->items[$key]) || array_key_exists($key, $this->items);
    }
923203
function get_record_expiration( $key ) {
            $this->_logger->entrance( 'key = ' . $key );

            $cache_entry = $this->_options->get_option( $key, false );

            if ( is_object( $cache_entry ) &&
                 isset( $cache_entry->timestamp ) &&
                 is_numeric( $cache_entry->timestamp ) &&
                 $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
            ) {
                return $cache_entry->timestamp;
            }

            return false;
        }
807529
public function cached($key) {
        global $USER;
        $this->ensure_session_cache_initialised();
        if (!array_key_exists($key, $this->session) || !is_array($this->session[$key]) || $this->session[$key][self::CACHEUSERID]!=$USER->id || $this->session[$key][self::CACHETIME] < $this->timeout) {
            return false;
        }
        return true;
    }
1355053
public function has($key)
    {
        if (!$this->isEnabled()) {
            return false;
        }

        return (false !== $this->server->get($this->prefix . $key));
    }
685828
public function getExpiry($key)
    {
        $key = $this->getPrefix().$key;
        if (!$this->isInCache($key)) {
            return false;
        }

        return $this->fetchExpirationFromCache($key);
    }
1313725
function is_expired()
    {
        $now = time();

        foreach ($this->subkeys as $subkey)
            if (!$subkey->expires || $subkey->expires > $now)
                return true;

        return false;
    }
759919
protected function exists($key)
    {
        if (!array_key_exists($key, $this->items)) {
            // key not in cache
            return false;
        }

        $expire = $this->items[$key][1];
        if ($expire !== 0 && $expire < time()) {
            // not permanent & already expired
            $this->size -= strlen($this->items[$key][0]);
            unset($this->items[$key]);

            return false;
        }

        $this->lru($key);

        return true;
    }
234601
public static function timeOf($key)
    {
        static::$with_meta = true;

        $cache = static::get($key);

        static::$with_meta = false;

        if ($cache == null) {
            return false;
        }

        return $cache['__bow_meta']['expire_at'];
    }
81468
public function has(string $key): bool
    {
        $file = $this->cacheFile($key);

        if (is_file($file)) {
            $data = include $file;
            $expire = (int)$data['ttl'];
            return $expire === 0 || time() < $expire;
        }

        return false;
    }
597948
public static function has(string $key) : bool
  {
    if ((new Cache)->retrieve($key) == null) return false;
    return true;
  }
856790
public function has(string $key): bool
    {
        if (array_key_exists($key, $this->ttl) &&
            $this->time() - $this->ttl[$key] > 0
        ) {
            unset($this->ttl[$key]);
            unset($this->storage[$key]);

            return false;
        }

        return array_key_exists($key, $this->storage);
    }
946653
public function exists(string $key): bool
    {
        $driver = $this->getDriver();
        $exists = $driver->get($key) !== null;
        if ($this->hasEventListeners('itemExists')) {
            $this->dispatchEvent('itemExists', new \BearFramework\App\Cache\ItemExistsEventDetails($key, $exists));
        }
        if ($this->hasEventListeners('itemRequest')) {
            $this->dispatchEvent('itemRequest', new \BearFramework\App\Cache\ItemRequestEventDetails($key));
        }
        return $exists;
    }
1014666
protected function getItem($key)
    {
        $cache_file = $this->path($key);
        if (!file_exists($cache_file) || !is_readable($cache_file)) {
            return false;
        }

        $cache_data = file_get_contents($cache_file);
        if (empty($cache_data)) {
            return false;
        }
        $cache_data = json_decode($cache_data, true);
        if ($cache_data) {
            $check_expire = $this->checkExpire($cache_data);
            if ($check_expire === false) {
                $this->delete($key);
                return false;
            }
        }

        return $cache_data;
    }