Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 773

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Closure class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="serializable.unserialize.html">Serializable::unserialize</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="closure.construct.html">Closure::__construct</a></div>
 <div class="up"><a href="reserved.interfaces.html">Predefined Interfaces and Classes</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.closure" class="reference">

 <h1 class="title">The Closure class</h1>
 

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


  <div class="section" id="closure.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    Class used to represent <a href="functions.anonymous.html" class="link">anonymous
    functions</a>.
   </p>

   <p class="para">
    Anonymous functions, implemented in PHP 5.3, yield objects of this type.
    This fact used to be considered an implementation detail, but it can now
    be relied upon. Starting with PHP 5.4, this class has methods that allow
    further control of the anonymous function after it has been created.
   </p>

   <p class="para">
    Besides the methods listed here, this class also has an
    <em>__invoke</em> method. This is for consistency with other
    classes that implement <a href="language.oop5.magic.html#language.oop5.magic.invoke" class="link">calling
    magic</a>, as this method is not used for calling the function.
   </p>

  </div>


  <div class="section" id="closure.synopsis">
   <h2 class="title">Class synopsis</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Closure</strong>
     </span>
     {</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">private</span>  <span class="methodname"><a href="closure.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">Closure</span> <span class="methodname"><a href="closure.bind.html" class="methodname">bind</a></span>
    ( <span class="methodparam"><span class="type"><a href="class.closure.html" class="type Closure">Closure</a></span> <code class="parameter">$closure</code></span>
   , <span class="methodparam"><span class="type">object</span> <code class="parameter">$newthis</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$newscope</code>
   <span class="initializer"> = &#039;static&#039;</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">Closure</span> <span class="methodname"><a href="closure.bindto.html" class="methodname">bindTo</a></span>
    ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$newthis</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$newscope</code>
   <span class="initializer"> = &#039;static&#039;</span></span>
  ] )</div>

   }</div>


  </div>

 </div>

 






 






 







<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="closure.construct.html">Closure::__construct</a> — Constructor that disallows instantiation</li><li><a href="closure.bind.html">Closure::bind</a> — Duplicates a closure with a specific bound object and class scope</li><li><a href="closure.bindto.html">Closure::bindTo</a> — Duplicates the closure with a new bound object and class scope</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="serializable.unserialize.html">Serializable::unserialize</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="closure.construct.html">Closure::__construct</a></div>
 <div class="up"><a href="reserved.interfaces.html">Predefined Interfaces and Classes</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>