CacheTool\Proxy\ApcuProxy::apcu_cas PHP Method

apcu_cas() public method

Updates an old value with a new value apcu_cas() updates an already existing integer value if the old parameter matches the currently stored value with the value of the new parameter.
Since: 3.1.1
public apcu_cas ( string $key, integer $old, integer $new ) : boolean
$key string The key of the value being updated.
$old integer The old value (the value currently stored).
$new integer The new value to update to
return boolean Returns TRUE on success or FALSE on failure.
    public function apcu_cas($key, $old, $new)
    {
        $code = new Code();
        $code->addStatement(sprintf('return apcu_cas(%s, %s, %s);', var_export($key, true), var_export($old, true), var_export($new, true)));
        return $this->adapter->run($code);
    }