<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.sem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.shm-put-var.php',
    1 => 'shm_put_var',
    2 => '共有メモリの変数を挿入または更新する',
  ),
  'up' => 
  array (
    0 => 'ref.sem.php',
    1 => 'セマフォ関数',
  ),
  'prev' => 
  array (
    0 => 'function.shm-has-var.php',
    1 => 'shm_has_var',
  ),
  'next' => 
  array (
    0 => 'function.shm-remove.php',
    1 => 'shm_remove',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/sem/functions/shm-put-var.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.shm-put-var" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">shm_put_var</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">shm_put_var</span> &mdash; <span class="dc-title">共有メモリの変数を挿入または更新する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.shm-put-var-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>shm_put_var</strong></span>(<span class="methodparam"><span class="type"><a href="class.sysvsharedmemory.php" class="type SysvSharedMemory">SysvSharedMemory</a></span> <code class="parameter">$shm</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</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="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   <span class="function"><strong>shm_put_var()</strong></span> は、
   指定した <code class="parameter">key</code> を有する
   変数 <code class="parameter">value</code> の挿入または更新を行います。
  </p>
  <p class="simpara">
   <code class="parameter">shm</code> が有効な SysV 共有メモリではない場合や
   リクエストを処理するために充分な共有メモリが残っていない場合は
   (<strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> レベルの) 警告を発生させます。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.shm-put-var-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
    <dt><code class="parameter">shm</code></dt>
    <dd>
     <span class="simpara">
      <span class="function"><a href="function.shm-attach.php" class="function">shm_attach()</a></span> が返す共有メモリセグメント。
     </span>
    </dd>
   
   
    <dt><code class="parameter">key</code></dt>
    <dd>
     <span class="simpara">
      変数のキー。
     </span>
    </dd>
   
   
    <dt><code class="parameter">value</code></dt>
    <dd>
     <span class="simpara">
      変数。<span class="function"><a href="function.serialize.php" class="function">serialize()</a></span> がサポートするすべての
      <a href="language.types.php" class="link">型</a>を使うことができます。
      通常これは、リソース型と一部の内部オブジェクト (シリアライズできないもの)
      以外のすべての型を意味します。
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.shm-put-var-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="simpara">
   成功した場合に <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> を返します。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.shm-put-var-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       引数 <code class="parameter">shm</code> は、
       <span class="classname"><a href="class.sysvsharedmemory.php" class="classname">SysvSharedMemory</a></span> クラスのインスタンスを期待するようになりました。
       これより前のバージョンでは、リソースが期待されていました。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.shm-put-var-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.shm-get-var.php" class="function" rel="rdfs-seeAlso">shm_get_var()</a> - 共有メモリから変数を返す</span></li>
   <li><span class="function"><a href="function.shm-has-var.php" class="function" rel="rdfs-seeAlso">shm_has_var()</a> - 特定のエントリが存在するかどうかを調べる</span></li>
  </ul>
 </div>


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