<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.shmop.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.shmop-write.php',
    1 => 'shmop_write',
    2 => 'Write data into shared memory block',
  ),
  'up' => 
  array (
    0 => 'ref.shmop.php',
    1 => 'Shared Memory Функції',
  ),
  'prev' => 
  array (
    0 => 'function.shmop-size.php',
    1 => 'shmop_size',
  ),
  'next' => 
  array (
    0 => 'class.shmop.php',
    1 => 'Shmop',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/shmop/functions/shmop-write.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.shmop-write" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">shmop_write</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">shmop_write</span> &mdash; <span class="dc-title">Write data into shared memory block</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.shmop-write-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>shmop_write</strong></span>(<span class="methodparam"><span class="type"><a href="class.shmop.php" class="type Shmop">Shmop</a></span> <code class="parameter">$shmop</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$offset</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>shmop_write()</strong></span> will write a string into shared memory block.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.shmop-write-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">shmop</code></dt>
     <dd>
      <p class="para">
       The shared memory block identifier created by 
       <span class="function"><a href="function.shmop-open.php" class="function">shmop_open()</a></span>
      </p>
     </dd>
    
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
       A string to write into shared memory block 
      </p>
     </dd>
    
    
     <dt><code class="parameter">offset</code></dt>
     <dd>
      <p class="para">
       Specifies where to start writing data inside the shared memory
       segment. The offset must be greater than or equal to zero
       and less than or equal to the actual size of the shared memory segment.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.shmop-write-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   The size of the written <code class="parameter">data</code>.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.shmop-write-errors">
  <h3 class="title">Помилки/виключення</h3>
  <p class="para">
   If <code class="parameter">offset</code> is out of range, or a read-only shared memory segment
   should be written to, a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> is thrown.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.shmop-write-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>
       Prior to PHP 8.0.0, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> was returned on failure.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">shmop</code> expects a <span class="classname"><a href="class.shmop.php" class="classname">Shmop</a></span>
       instance now; previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.shmop-write-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 Writing to shared memory block</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$shm_bytes_written </span><span style="color: #007700">= </span><span style="color: #0000BB">shmop_write</span><span style="color: #007700">(</span><span style="color: #0000BB">$shm_id</span><span style="color: #007700">, </span><span style="color: #0000BB">$my_string</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   This example will write data inside <code class="literal">$my_string</code> into
   shared memory block, <code class="literal">$shm_bytes_written</code> will contain
   the number of bytes written.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.shmop-write-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.shmop-read.php" class="function" rel="rdfs-seeAlso">shmop_read()</a> - Read data from shared memory block</span></li>
   </ul>
  </p>
 </div>

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