public function decrement($key, $val = 1) { $this->lock = true; $v = $this->get($key); if (is_int($v)) { return $this->update($key, $v - abs(intval($val))); } else { return false; } }