K2hdkc::casInit K2hdkc Class K2hdkc::clearSubkeys

K2hdkc::casSet

Sets a value using CAS operation

Description

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

Sets 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", 0);
$handle->casSet("key", 0, 1);
var_dump($handle->casGet("key"));
$handle->close();
'

The above example will output:

int(1)

See Also

K2hdkc::casInit K2hdkc Class K2hdkc::clearSubkeys