<?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.generator.php',
    1 => 'Generator',
    2 => 'The Generator class',
  ),
  'up' => 
  array (
    0 => 'reserved.interfaces.php',
    1 => 'Interfacce e Classi predefinite',
  ),
  'prev' => 
  array (
    0 => 'class.stdclass.php',
    1 => 'stdClass',
  ),
  'next' => 
  array (
    0 => 'generator.current.php',
    1 => 'Generator::current',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/predefined/generator.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.generator.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.generator" class="reference">

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

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


  <div class="section" id="generator.intro">
   <h2 class="title">Introduzione</h2>
   <p class="para">
    <span class="classname"><strong class="classname">Generator</strong></span> objects are returned from <a href="language.generators.php" class="link">generators</a>.
   </p>
   
   <div class="caution"><strong class="caution">Attenzione</strong>
    <p class="para">
     <span class="classname"><strong class="classname">Generator</strong></span> objects cannot be instantiated via
     <a href="language.oop5.basic.php#language.oop5.basic.new" class="link">new</a>.
    </p>
   </div>

  </div>


  <div class="section" id="generator.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">Generator</strong></strong>
    

    
     <span class="modifier">implements</span>
      <a href="class.iterator.php" class="interfacename">Iterator</a> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Metodi */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="generator.current.php" class="methodname">current</a></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="methodname"><a href="generator.getreturn.php" class="methodname">getReturn</a></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="methodname"><a href="generator.key.php" class="methodname">key</a></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="methodname"><a href="generator.next.php" class="methodname">next</a></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="generator.rewind.php" class="methodname">rewind</a></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="generator.send.php" class="methodname">send</a></span>(<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$value</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="methodname"><a href="generator.throw.php" class="methodname">throw</a></span>(<span class="methodparam"><span class="type"><a href="class.throwable.php" class="type Throwable">Throwable</a></span> <code class="parameter">$exception</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="methodname"><a href="generator.valid.php" class="methodname">valid</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="generator.wakeup.php" class="methodname">__wakeup</a></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

   }</div>


  </div>

  <div class="section" id="generator.seealso">
   <h2 class="title">Vedere anche:</h2>
   <p class="para">See also <a href="language.oop5.iterations.php" class="link">object iteration</a>.</p>
  </div>

 </div>

 




 




 




 




 




 




 




 




 







<h2>Indice dei contenuti</h2><ul class="chunklist chunklist_reference"><li><a href="generator.current.php">Generator::current</a> — Get the yielded value</li><li><a href="generator.getreturn.php">Generator::getReturn</a> — Get the return value of a generator</li><li><a href="generator.key.php">Generator::key</a> — Get the yielded key</li><li><a href="generator.next.php">Generator::next</a> — Resume execution of the generator</li><li><a href="generator.rewind.php">Generator::rewind</a> — Execute the generator up to and including the first yield</li><li><a href="generator.send.php">Generator::send</a> — Send a value to the generator</li><li><a href="generator.throw.php">Generator::throw</a> — Throw an exception into the generator</li><li><a href="generator.valid.php">Generator::valid</a> — Check if the iterator has been closed</li><li><a href="generator.wakeup.php">Generator::__wakeup</a> — Serialize callback</li></ul>
</div>
<?php manual_footer($setup); ?>