Memcached::replace
PHP function
Edit on GitHub ✎
(PECL memcached >= 0.1.0)
Replace the item under an existing key
Description
Memcached::replace(string $key, mixed $value, int $expiration = 0): bool
Memcached::replace() is similar to Memcached::set, but the operation fails if the key does not exist on the server.
Parameters
keyKey
valueValue
expirationExpiration
Return Values
Success The Memcached::getResultCode will return Memcached::RES_NOTSTORED if the key does not exist.
See Also
Memcached::replaceByKeyMemcached::setMemcached::add