/** * Returns the time to live of a key that can expire in ms. * @param $key * @return int */ public function getTimeToLive($key) { $this->connectIfNeeded(); return $this->redis->pttl($key); }