/** * 递减 * @param string $key 键名 * @param int $step 递减步长 * @return int|false 递减后的值,失败返回false */ public function decr($key, $step = 1) { if (!is_int($step)) { return false; } try { return $this->handler->incrBy($key, -$step); } catch (RedisException $ex) { self::exception($ex); //连接状态置为false $this->isConnected = false; } return false; }