mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
141 lines
3.7 KiB
XML
141 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.shmop-write">
|
|
<refnamediv>
|
|
<refname>shmop_write</refname>
|
|
<refpurpose>Write data into shared memory block</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>shmop_write</methodname>
|
|
<methodparam><type>Shmop</type><parameter>shmop</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
<function>shmop_write</function> will write a string into shared memory block.
|
|
</simpara>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>shmop</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
The shared memory block identifier created by
|
|
<function>shmop_open</function>
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
A string to write into shared memory block
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>offset</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
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.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
The size of the written <parameter>data</parameter>.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<simpara>
|
|
If <parameter>offset</parameter> is out of range, or a read-only shared memory segment
|
|
should be written to, a <classname>ValueError</classname> is thrown.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
Prior to PHP 8.0.0, &false; was returned on failure.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>shmop</parameter> expects a <classname>Shmop</classname>
|
|
instance now; previously, a <type>resource</type> was expected.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Writing to shared memory block</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$shm_bytes_written = shmop_write($shm_id, $my_string, 0);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<simpara>
|
|
This example will write data inside <literal>$my_string</literal> into
|
|
shared memory block, <literal>$shm_bytes_written</literal> will contain
|
|
the number of bytes written.
|
|
</simpara>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>shmop_read</function></member>
|
|
</simplelist>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|