<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.memcache.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'memcache.decrement.php',
    1 => 'Memcache::decrement',
    2 => 'Decrement item\'s value',
  ),
  'up' => 
  array (
    0 => 'class.memcache.php',
    1 => 'Memcache',
  ),
  'prev' => 
  array (
    0 => 'memcache.connect.php',
    1 => 'Memcache::connect',
  ),
  'next' => 
  array (
    0 => 'memcache.delete.php',
    1 => 'Memcache::delete',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/memcache/memcache/decrement.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="memcache.decrement" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcache::decrement</h1>
  <h1 class="refname">memcache_decrement</h1>
  <p class="verinfo">(PECL memcache &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">Memcache::decrement</span> -- <span class="refname">memcache_decrement</span> &mdash; <span class="dc-title">Decrement item&#039;s value</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-memcache.decrement-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>Memcache::decrement</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.integer.php" class="type int">int</a></span> <code class="parameter">$value</code><span class="initializer"> = 1</span></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <div class="methodsynopsis dc-description"><span class="methodname"><strong>memcache_decrement</strong></span>(<span class="methodparam"><span class="type"><a href="class.memcache.php" class="type Memcache">Memcache</a></span> <code class="parameter">$memcache</code></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.integer.php" class="type int">int</a></span> <code class="parameter">$value</code><span class="initializer"> = 1</span></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>


  <p class="para rdfs-comment">
   <span class="function"><strong>Memcache::decrement()</strong></span> decrements value of the
   item by <code class="parameter">value</code>. Similarly to
   <span class="function"><a href="memcache.increment.php" class="function">Memcache::increment()</a></span>, current value of the item is
   being converted to numerical and after that <code class="parameter">value</code>
   is subtracted.
   <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
    <span class="simpara">
     New item&#039;s value will not be less than zero.
    </span>
   </p></blockquote>
   <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
    <span class="simpara">
     Do not use <span class="function"><strong>Memcache::decrement()</strong></span> with item, which was
     stored compressed, because consequent call to
     <span class="function"><a href="memcache.get.php" class="function">Memcache::get()</a></span> will fail.
    </span>
   </p></blockquote>
   <span class="function"><strong>Memcache::decrement()</strong></span> <em>does not</em>
   create an item if it didn&#039;t exist.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-memcache.decrement-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   
    <dt><code class="parameter">key</code></dt>
    <dd>
     <span class="simpara">
      Key of the item do decrement.
     </span>
    </dd>
   
   
    <dt><code class="parameter">value</code></dt>
    <dd>
     <span class="simpara">
      Decrement the item by <code class="parameter">value</code>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-memcache.decrement-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="simpara">
   Returns item&#039;s new value on successBei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben..
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-memcache.decrement-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 <span class="function"><strong>Memcache::decrement()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/* procedural API */<br /></span><span style="color: #0000BB">$memcache_obj </span><span style="color: #007700">= </span><span style="color: #0000BB">memcache_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">, </span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* decrement item by 2 */<br /></span><span style="color: #0000BB">$new_value </span><span style="color: #007700">= </span><span style="color: #0000BB">memcache_decrement</span><span style="color: #007700">(</span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">, </span><span style="color: #DD0000">'test_item'</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* OO API */<br /></span><span style="color: #0000BB">$memcache_obj </span><span style="color: #007700">= new </span><span style="color: #0000BB">Memcache</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">, </span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* decrement item by 3 */<br /></span><span style="color: #0000BB">$new_value </span><span style="color: #007700">= </span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">decrement</span><span style="color: #007700">(</span><span style="color: #DD0000">'test_item'</span><span style="color: #007700">, </span><span style="color: #0000BB">3</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-memcache.decrement-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="memcache.increment.php" class="function" rel="rdfs-seeAlso">Memcache::increment()</a> - Increment item's value</span></li>
   <li><span class="function"><a href="memcache.replace.php" class="function" rel="rdfs-seeAlso">Memcache::replace()</a> - Replace value of the existing item</span></li>
  </ul>
 </div>


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