<?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 => 'es',
  ),
  'this' => 
  array (
    0 => 'reflectionparameter.iscallable.php',
    1 => 'ReflectionParameter::isCallable',
    2 => 'Verifica si el par&aacute;metro es de tipo callable',
  ),
  'up' => 
  array (
    0 => 'class.reflectionparameter.php',
    1 => 'ReflectionParameter',
  ),
  'prev' => 
  array (
    0 => 'reflectionparameter.isarray.php',
    1 => 'ReflectionParameter::isArray',
  ),
  'next' => 
  array (
    0 => 'reflectionparameter.isdefaultvalueavailable.php',
    1 => 'ReflectionParameter::isDefaultValueAvailable',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/reflection/reflectionparameter/iscallable.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionparameter.iscallable" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionParameter::isCallable</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.4.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ReflectionParameter::isCallable</span> &mdash; <span class="dc-title">Verifica si el parámetro es de tipo <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span></span></p>

 </div>

 <div id="reflectionparameter.iscallable-refsynopsisdiv">
  <div class="warning"><strong class="warning">Advertencia</strong><p class="simpara">Esta función está
<em>OBSOLETA</em> a partir de PHP 8.0.0. Depender de esta función
está altamente desaconsejado.</p></div>
  <p class="para">Ver el ejemplo a continuación para un método alternativo para obtener esta información.</p>
 </div>

 <div class="refsect1 description" id="refsect1-reflectionparameter.iscallable-description">
  <h3 class="title">Descripción</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::isCallable</strong></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">

  </p>

  
<div class="warning"><strong class="warning">Advertencia</strong>
<p class="simpara">
 Esta función está actualmente no documentada; solo la lista de sus argumentos está disponible.
</p>
</div>


 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionparameter.iscallable-parameters">
  <h3 class="title">Parámetros</h3>
  <p class="para">Esta función no contiene ningún parámetro.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionparameter.iscallable-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   Retorna <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> si el parámetro es de tipo <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span>, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
   si no lo es, o <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> si ocurre un error.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-reflectionparameter.iscallable-changelog">
  <h3 class="title">Historial de cambios</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versión</th>
      <th>Descripción</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       Esta función ahora está obsoleta, reemplazada por
       <span class="methodname"><a href="reflectionparameter.gettype.php" class="methodname">ReflectionParameter::getType()</a></span>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-reflectionparameter.iscallable-examples">
  <h3 class="title">Ejemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Ejemplo #1 Equivalente PHP 8.0.0</strong></p>
    <div class="example-contents"><p>
     A partir de PHP 8.0.0, el siguiente código indicará si un tipo soporta
     callables, incluyendo aquellos que forman parte de una unión.
    </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">declaresCallable</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">'callable'</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><?php manual_footer($setup); ?>