array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'memcached.replace.php', 1 => 'Memcached::replace', 2 => 'Replace the item under an existing key', ), 'up' => array ( 0 => 'class.memcached.php', 1 => 'Memcached', ), 'prev' => array ( 0 => 'memcached.quit.php', 1 => 'Memcached::quit', ), 'next' => array ( 0 => 'memcached.replacebykey.php', 1 => 'Memcached::replaceByKey', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/memcached/memcached/replace.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Memcached::replace

(PECL memcached >= 0.1.0)

Memcached::replaceReplace the item under an existing key

Опис

public 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.

Параметри

key

Ключ, під яким зберігається значення.

value

Значення для зберігання.

expiration

Термін зберігання, стандарно — 0. Докладніше: Терміни зберігання.

Значення, що повертаються

Повертає true у разі успіху або false в разі помилки. The Memcached::getResultCode() will return Memcached::RES_NOTSTORED if the key does not exist.

Прогляньте також