src/Adapters/MemoryStore.php
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;
    }
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;
    }
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 ; }
Checks if a value exists in cache and is not yet expired.

@param string $key

@return bool
Checks if a value exists in cache and is not yet expired .