<?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 => 'it',
  ),
  'this' => 
  array (
    0 => 'ffi.arraytype.php',
    1 => 'FFI::arrayType',
    2 => 'Dynamically constructs a new C array type',
  ),
  'up' => 
  array (
    0 => 'class.ffi.php',
    1 => 'FFI',
  ),
  'prev' => 
  array (
    0 => 'ffi.alignof.php',
    1 => 'FFI::alignof',
  ),
  'next' => 
  array (
    0 => 'ffi.cast.php',
    1 => 'FFI::cast',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ffi/ffi/arraytype.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ffi.arraytype" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">FFI::arrayType</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.4.0, PHP 8)</p><p class="refpurpose"><span class="refname">FFI::arrayType</span> &mdash; <span class="dc-title">Dynamically constructs a new C array type</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-ffi.arraytype-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>FFI::arrayType</strong></span>(<span class="methodparam"><span class="type"><a href="class.ffi-ctype.php" class="type FFI\CType">FFI\CType</a></span> <code class="parameter">$type</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$dimensions</code></span>): <span class="type"><a href="class.ffi-ctype.php" class="type FFI\CType">FFI\CType</a></span></div>

  <p class="para rdfs-comment">
   Dynamically constructs a new C array type with elements of type defined by <code class="parameter">type</code>,
   and dimensions specified by <code class="parameter">dimensions</code>. In the following example <code class="code">$t1</code>
   and <code class="code">$t2</code> are equivalent array types:
   <div class="informalexample">
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$t1 </span><span style="color: #007700">= </span><span style="color: #0000BB">FFI</span><span style="color: #007700">::</span><span style="color: #0000BB">type</span><span style="color: #007700">(</span><span style="color: #DD0000">"int[2][3]"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$t2 </span><span style="color: #007700">= </span><span style="color: #0000BB">FFI</span><span style="color: #007700">::</span><span style="color: #0000BB">arrayType</span><span style="color: #007700">(</span><span style="color: #0000BB">FFI</span><span style="color: #007700">::</span><span style="color: #0000BB">type</span><span style="color: #007700">(</span><span style="color: #DD0000">"int"</span><span style="color: #007700">), [</span><span style="color: #0000BB">2</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>
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-ffi.arraytype-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">type</code></dt>
    <dd>
     <span class="simpara">
      A valid C declaration as <span class="type"><a href="language.types.string.php" class="type string">string</a></span>, or an instance of <span class="classname"><a href="class.ffi-ctype.php" class="classname">FFI\CType</a></span>
      which has already been created.
     </span>
    </dd>
   
   
    <dt><code class="parameter">dimensions</code></dt>
    <dd>
     <span class="simpara">
      The dimensions of the type as <span class="type"><a href="language.types.array.php" class="type array">array</a></span>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-ffi.arraytype-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="simpara">
   Returns the freshly created <span class="classname"><a href="class.ffi-ctype.php" class="classname">FFI\CType</a></span> object.
  </p>
 </div>


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