<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectionparameter.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'reflectionparameter.isarray.php',
    1 => 'ReflectionParameter::isArray',
    2 => 'Checks if parameter expects an array',
  ),
  'up' => 
  array (
    0 => 'class.reflectionparameter.php',
    1 => 'ReflectionParameter',
  ),
  'prev' => 
  array (
    0 => 'reflectionparameter.hastype.php',
    1 => 'ReflectionParameter::hasType',
  ),
  'next' => 
  array (
    0 => 'reflectionparameter.iscallable.php',
    1 => 'ReflectionParameter::isCallable',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/reflection/reflectionparameter/isarray.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionparameter.isarray" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionParameter::isArray</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.2, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ReflectionParameter::isArray</span> &mdash; <span class="dc-title">Checks if parameter expects an array</span></p>

 </div>

 <div id="reflectionparameter.isarray-refsynopsisdiv">
   <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function has been
<em>DEPRECATED</em> as of PHP 8.0.0. Relying on this function
is highly discouraged.</p></div>
  <p class="para">See the example below for an alternative way to derive this information.</p>
 </div>

 <div class="refsect1 description" id="refsect1-reflectionparameter.isarray-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="attribute"><a href="class.deprecated.php">#[\Deprecated]</a> </span><br>
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionParameter::isArray</strong></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Checks if the parameter expects an array.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionparameter.isarray-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionparameter.isarray-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> if an <span class="type"><a href="language.types.array.php" class="type array">array</a></span> is expected, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> otherwise.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-reflectionparameter.isarray-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       This function has been deprecated in favor of
       <span class="methodname"><a href="reflectionparameter.gettype.php" class="methodname">ReflectionParameter::getType()</a></span> instead.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-reflectionparameter.isarray-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 PHP 8.0.0 equivalent</strong></p>
    <div class="example-contents"><p>
     As of PHP 8.0.0, the following code will report if a type declares arrays,
     including as part of a union.
    </p></div>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">declaresArray</span><span style="color: #007700">(</span><span style="color: #0000BB">ReflectionParameter $reflectionParameter</span><span style="color: #007700">): </span><span style="color: #0000BB">bool<br /></span><span style="color: #007700">{<br />    </span><span style="color: #0000BB">$reflectionType </span><span style="color: #007700">= </span><span style="color: #0000BB">$reflectionParameter</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getType</span><span style="color: #007700">();<br /><br />    if (!</span><span style="color: #0000BB">$reflectionType</span><span style="color: #007700">) return </span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /><br />    </span><span style="color: #0000BB">$types </span><span style="color: #007700">= </span><span style="color: #0000BB">$reflectionType </span><span style="color: #007700">instanceof </span><span style="color: #0000BB">ReflectionUnionType<br />        </span><span style="color: #007700">? </span><span style="color: #0000BB">$reflectionType</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTypes</span><span style="color: #007700">()<br />        : [</span><span style="color: #0000BB">$reflectionType</span><span style="color: #007700">];<br /><br />   return </span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #DD0000">'array'</span><span style="color: #007700">, </span><span style="color: #0000BB">array_map</span><span style="color: #007700">(fn(</span><span style="color: #0000BB">ReflectionNamedType $t</span><span style="color: #007700">) =&gt; </span><span style="color: #0000BB">$t</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getName</span><span style="color: #007700">(), </span><span style="color: #0000BB">$types</span><span style="color: #007700">));<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectionparameter.isarray-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="reflectionparameter.isoptional.php" class="methodname" rel="rdfs-seeAlso">ReflectionParameter::isOptional()</a> - Checks if optional</span></li>
   </ul>
  </p>
 </div>


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