decrement() public méthode

Note that, as per the XCache specification: If the item's value is not numeric, it is treated as if the value were 0. It is possible to decrement a value into the negative integers.
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`.
Résultat integer | boolean The item's new value on successful decrement, else `false`.
Exemple #1
0
 public function testDecrementWithScope()
 {
     $adapter = new XCache(array('scope' => 'primary'));
     xcache_set('primary:key1', 1, 60);
     xcache_set('key1', 1, 60);
     $adapter->decrement('key1');
     $expected = 1;
     $result = xcache_get('key1');
     $this->assertEqual($expected, $result);
     $expected = 0;
     $result = xcache_get('primary:key1');
     $this->assertEqual($expected, $result);
 }