source/Redis/Connection.php
public function ttl($key) {
        try {
            $result = $this->getRedis()->pttl($key);
            return ($result != -1) ? $result : false;
        } catch (RedisException $ex) {
            throw new ConnectException();
        }
    }
public function ttl($key) {
        try {
            $result = $this->getRedis()->pttl($key);
            return ($result != -1) ? $result : false;
        } catch (RedisException $ex) {
            throw new ConnectException();
        }
    }
public function ttl ( $ key ) { try { $ result = $ this -> getRedis ( ) -> pttl ( $ key ) ; return ( $ result != - 1 ) ? $ result : false ; } catch ( RedisException $ ex ) { throw new ConnectException ( ) ; } }
Get ttl of the key
@param string $key key
@return int|bool ttl in milliseconds or false, if ttl is not set or key not found
@throws ConnectException exception on connection to redis instance
Get ttl of the key