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