选择语言 :

 Driver_Cache_Driver_Apc::decrement

递减

与原始decrement方法区别的是若不存指定KEY时返回false,这个会自动递减

boolean Driver_Cache_Driver_Apc::decrement( string $key [, int $offset = integer 1 , int $lifetime = integer 60 ] )

参数列表

参数 类型 描述 默认值
$key string $key
$offset int $offset integer 1
$lifetime int 当递减失则时当作set使用 integer 60
返回值
  • boolean
File: ./drivers/cache/apc/apc.class.php
public function decrement($key, $offset = 1, $lifetime = 60)
{
    if ( apc_dec($this->prefix . $key, $offset) )
    {
        return true;
    }
    elseif ( false==apc_exists($this->prefix . $key) && $this->set($key, $offset, $lifetime) )
    {
        return true;
    }
    else
    {
        return false;
    }
}