public function expires($key)
    {
        if (!isset($this->records[$key])) {
            return 0;
        }

        return (int) max(0, $this->records[$key]['expire'] - time());
    }
public function expires($key)
    {
        if (!isset($this->records[$key])) {
            return 0;
        }

        return (int) max(0, $this->records[$key]['expire'] - time());
    }
public function expires ( $ key ) { if ( ! isset ( $ this -> records [ $ key ] ) ) { return 0 ; } return ( int ) max ( 0 , $ this -> records [ $ key ] [ 'expire' ] - time ( ) ) ; }
Return seconds left until the key expires.

@param string $key

@return int The number of seconds the key is valid. 0 if expired or unknown.
Return seconds left until the key expires .