<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/reserved.interfaces.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'class.closure.php',
    1 => 'Closure',
    2 => 'La classe Closure',
  ),
  'up' => 
  array (
    0 => 'reserved.interfaces.php',
    1 => 'Interfacce e Classi predefinite',
  ),
  'prev' => 
  array (
    0 => 'serializable.unserialize.php',
    1 => 'Serializable::unserialize',
  ),
  'next' => 
  array (
    0 => 'closure.construct.php',
    1 => 'Closure::__construct',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'language/predefined/closure.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.closure.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.closure" class="reference">
 
 <h1 class="title">La classe Closure</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p>

  
  <div class="section" id="closure.intro">
   <h2 class="title">Introduzione</h2>
   <p class="para">
    Classe usata per rappresentare <a href="functions.anonymous.php" class="link">funzioni anonime</a>.
   </p>

   <p class="para">
    Le funzioni anonime producono oggetti di questo tipo.
    Questa classe contiene dei metodi che consentono
    un ulteriore controllo della funzione anonima dopo che è stata creata.
   </p>

   <p class="para">
    Oltre ai metodi qui elencati, questa classe ha anche un metodo <code class="literal">__invoke</code>. 
    Questo è stato implementato per dare coerenza con le altre classi che implementano le 
    <a href="language.oop5.magic.php#language.oop5.magic.invoke" class="link">chiamate magiche</a>, dato che questo metodo 
    non viene usato per chiamare la funzione.
   </p>

  </div>
  

  <div class="section" id="closure.synopsis">
   <h2 class="title">Sommario della classe</h2>

   
   <div class="classsynopsis"><div class="classsynopsisinfo">
    
     <span class="modifier">final</span>
     <span class="modifier">class</span> <strong class="classname"><strong class="classname">Closure</strong></strong>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Metodi */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">private</span> <span class="methodname"><a href="closure.construct.php" class="methodname">__construct</a></span>()</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="closure.bind.php" class="methodname">bind</a></span>(<span class="methodparam"><span class="type"><a href="class.closure.php" class="type Closure">Closure</a></span> <code class="parameter">$closure</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.object.php" class="type object">object</a></span></span> <code class="parameter">$newThis</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.object.php" class="type object">object</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span> <code class="parameter">$newScope</code><span class="initializer"> = &quot;static&quot;</span></span>): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.closure.php" class="type Closure">Closure</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="closure.bindto.php" class="methodname">bindTo</a></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">$newThis</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.object.php" class="type object">object</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span> <code class="parameter">$newScope</code><span class="initializer"> = &quot;static&quot;</span></span>): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.closure.php" class="type Closure">Closure</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="closure.call.php" class="methodname">call</a></span>(<span class="methodparam"><span class="type"><a href="language.types.object.php" class="type object">object</a></span> <code class="parameter">$newThis</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">...$args</code></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="closure.fromcallable.php" class="methodname">fromCallable</a></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>): <span class="type"><a href="class.closure.php" class="type Closure">Closure</a></span></div>

   }</div>
   

  </div>

 </div>

 





 




 





 




 





<h2>Indice dei contenuti</h2><ul class="chunklist chunklist_reference"><li><a href="closure.construct.php">Closure::__construct</a> — Costruttore che non permette l'istanziazione</li><li><a href="closure.bind.php">Closure::bind</a> — Duplicates a closure with a specific bound object and class scope</li><li><a href="closure.bindto.php">Closure::bindTo</a> — Duplica la closure con una nuova associazione all'oggetto e alla visibilit&agrave; della classe</li><li><a href="closure.call.php">Closure::call</a> — Binds and calls the closure</li><li><a href="closure.fromcallable.php">Closure::fromCallable</a> — Converts a callable into a closure</li></ul>
</div>
<?php manual_footer($setup); ?>