<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectionmethod.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'reflectionmethod.getclosure.php',
    1 => 'ReflectionMethod::getClosure',
    2 => 'Devuelve una funci&oacute;n an&oacute;nima creada din&aacute;micamente para el m&eacute;todo',
  ),
  'up' => 
  array (
    0 => 'class.reflectionmethod.php',
    1 => 'ReflectionMethod',
  ),
  'prev' => 
  array (
    0 => 'reflectionmethod.export.php',
    1 => 'ReflectionMethod::export',
  ),
  'next' => 
  array (
    0 => 'reflectionmethod.getdeclaringclass.php',
    1 => 'ReflectionMethod::getDeclaringClass',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/reflection/reflectionmethod/getclosure.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionmethod.getclosure" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionMethod::getClosure</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.4.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ReflectionMethod::getClosure</span> &mdash; <span class="dc-title">Devuelve una función anónima creada dinámicamente para el método</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectionmethod.getclosure-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionMethod::getClosure</strong></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.object.php" class="type object">object</a></span></span> <code class="parameter">$object</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.closure.php" class="type Closure">Closure</a></span></div>

  <p class="para rdfs-comment">
   Crea una función anónima que llamará a este método.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionmethod.getclosure-parameters">
  <h3 class="title">Parámetros</h3>
  <dl>
   
    <dt><code class="parameter">object</code></dt>
    <dd>
     <p class="para">
      Prohibido para los métodos estáticos, requerido para los demás métodos.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionmethod.getclosure-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   Devuelve un objeto <span class="classname"><a href="class.closure.php" class="classname">Closure</a></span> recién creado.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-reflectionmethod.getclosure-errors">
  <h3 class="title">Errores/Excepciones</h3>
  <p class="para">
   Genera una <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> si <code class="parameter">object</code>
   es <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> pero el método no es estático.
  </p>
  <p class="para">
   Genera una <span class="classname"><a href="class.reflectionexception.php" class="classname">ReflectionException</a></span> si
   <code class="parameter">object</code> no es una instancia de la clase de la que
   este método fue declarado.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-reflectionmethod.getclosure-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>
       <code class="parameter">object</code> ahora es nullable.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-reflectionmethod.getclosure-seealso">
  <h3 class="title">Ver también</h3>
  <ul class="simplelist">
   <li><a href="functions.first_class_callable_syntax.php" class="link">Sintaxis callable de primera clase</a></li>
  </ul>
 </div>


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