K2hdkc::addSubkey K2hdkc Class K2hdkc::casGet

K2hdkc::casDecrement

Decrements a value using CAS operation

Description

    public function casDecrement(
        string $key,
        string $password = null,
        int $expiration_duration = 0): bool {}

Decrements a value using CAS operation.

Parameters

Return Values

Returns true on success, otherwise false.

Examples

php -r '
$handle = new K2hdkc("./tests/slave.ini");
$handle->casInit("key", 1);
$handle->casDecrement("key");
var_dump($handle->casGet("key"));
$handle->close();
'

The above example will output:

int(0)

See Also

K2hdkc::addSubkey K2hdkc Class K2hdkc::casGet