<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.memcached.inc";
$setup = array (
  'home' => 
  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);

?>
<div id="memcached.replace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcached::replace</h1>
  <p class="verinfo">(PECL memcached &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">Memcached::replace</span> &mdash; <span class="dc-title">Replace the item under an existing key</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-memcached.replace-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Memcached::replace</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$key</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$expiration</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>Memcached::replace()</strong></span> is similar to
   <span class="methodname"><a href="memcached.set.php" class="methodname">Memcached::set()</a></span>, but the operation fails if the
   <code class="parameter">key</code> does not exist on the server.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-memcached.replace-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">key</code></dt>
     <dd>
      <p class="para">
       Ключ, під яким зберігається значення.
      </p>
     </dd>
    
    
     <dt><code class="parameter">value</code></dt>
     <dd>
      <p class="para">
       Значення для зберігання.
      </p>
     </dd>
    
    
     <dt><code class="parameter">expiration</code></dt>
     <dd>
      <p class="para">
       Термін зберігання, стандарно — 0. Докладніше: <a href="memcached.expiration.php" class="link">Терміни
зберігання</a>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-memcached.replace-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Повертає <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> у разі успіху або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
   The <span class="methodname"><a href="memcached.getresultcode.php" class="methodname">Memcached::getResultCode()</a></span> will return
   <strong><code><a href="memcached.constants.php#memcached.constants.res-notstored">Memcached::RES_NOTSTORED</a></code></strong> if the key does not exist.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-memcached.replace-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="memcached.replacebykey.php" class="methodname" rel="rdfs-seeAlso">Memcached::replaceByKey()</a> - Replace the item under an existing key on a specific server</span></li>
    <li><span class="methodname"><a href="memcached.set.php" class="methodname" rel="rdfs-seeAlso">Memcached::set()</a> - Store an item</span></li>
    <li><span class="methodname"><a href="memcached.add.php" class="methodname" rel="rdfs-seeAlso">Memcached::add()</a> - Add an item under a new key</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>