<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.ffi.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'ffi.string.php',
    1 => 'FFI::string',
    2 => 'Creates a PHP string from a memory area',
  ),
  'up' => 
  array (
    0 => 'class.ffi.php',
    1 => 'FFI',
  ),
  'prev' => 
  array (
    0 => 'ffi.sizeof.php',
    1 => 'FFI::sizeof',
  ),
  'next' => 
  array (
    0 => 'ffi.type.php',
    1 => 'FFI::type',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ffi/ffi/string.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ffi.string" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">FFI::string</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.4.0, PHP 8)</p><p class="refpurpose"><span class="refname">FFI::string</span> &mdash; <span class="dc-title">Creates a PHP string from a memory area</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-ffi.string-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>FFI::string</strong></span>(<span class="methodparam"><span class="type"><a href="class.ffi-cdata.php" class="type FFI\CData">FFI\CData</a></span> <code class="parameter reference">&$ptr</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$size</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="simpara">
   Creates a PHP <span class="type"><a href="language.types.string.php" class="type string">string</a></span> from <code class="parameter">size</code> bytes of the memory area
   pointed to by <code class="parameter">ptr</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-ffi.string-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   
    <dt><code class="parameter">ptr</code></dt>
    <dd>
     <span class="simpara">
      The start of the memory area from which to create a <span class="type"><a href="language.types.string.php" class="type string">string</a></span>.
     </span>
    </dd>
   
   
    <dt><code class="parameter">size</code></dt>
    <dd>
     <span class="simpara">
      The number of bytes to copy to the <span class="type"><a href="language.types.string.php" class="type string">string</a></span>.
      If <code class="parameter">size</code> is omitted or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, <code class="parameter">ptr</code> must be a zero terminated
      array of C <code class="literal">char</code>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-ffi.string-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="simpara">
   The freshly created PHP <span class="type"><a href="language.types.string.php" class="type string">string</a></span>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-ffi.string-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">size</code> is nullable now; previously, its default was
       <code class="literal">0</code>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


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