decrement() public method

Note that, as per the APC specification: If the item's value is not numeric, the decrement operation has no effect on the key - it retains its original non-integer value.
public decrement ( string $key, integer $offset = 1 ) : integer | boolean
$key string Key of numeric cache item to decrement.
$offset integer Offset to decrement - defaults to `1`.
return integer | boolean The item's new value on successful decrement, else `false`.
Example #1
0
 public function testDecrementWithScope()
 {
     $adapter = new Apc(array('scope' => 'primary'));
     apc_store('primary:key1', 1, 60);
     apc_store('key1', 1, 60);
     $adapter->decrement('key1');
     $expected = 1;
     $result = apc_fetch('key1');
     $this->assertEqual($expected, $result);
     $expected = 0;
     $result = apc_fetch('primary:key1');
     $this->assertEqual($expected, $result);
 }