<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/spl.iterators.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'class.iteratoriterator.php',
    1 => 'IteratorIterator',
    2 => 'The IteratorIterator class',
  ),
  'up' => 
  array (
    0 => 'spl.iterators.php',
    1 => 'Iterators',
  ),
  'prev' => 
  array (
    0 => 'infiniteiterator.next.php',
    1 => 'InfiniteIterator::next',
  ),
  'next' => 
  array (
    0 => 'iteratoriterator.construct.php',
    1 => 'IteratorIterator::__construct',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/spl/iteratoriterator.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.iteratoriterator.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

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

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

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


  <div class="section" id="iteratoriterator.intro">
   <h2 class="title">Introduzione</h2>
   <p class="para">
    This iterator wrapper allows the conversion of anything that is
    <a href="class.traversable.php" class="link">Traversable</a> into an Iterator.
    It is important to understand that most classes that do not implement
    Iterators have reasons as most likely they do not allow the full
    Iterator feature set. If so, techniques should be provided to prevent
    misuse, otherwise expect exceptions or fatal errors.
   </p>
  </div>


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


   <div class="classsynopsis"><div class="classsynopsisinfo">
    
     <span class="modifier">class</span> <strong class="classname"><strong class="classname">IteratorIterator</strong></strong>
    

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

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Metodi */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="iteratoriterator.construct.php" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type"><a href="class.traversable.php" class="type Traversable">Traversable</a></span> <code class="parameter">$iterator</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.string.php" class="type string">string</a></span></span> <code class="parameter">$class</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="iteratoriterator.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="iteratoriterator.getinneriterator.php" class="methodname">getInnerIterator</a></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.iterator.php" class="type Iterator">Iterator</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="iteratoriterator.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="iteratoriterator.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="iteratoriterator.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="iteratoriterator.valid.php" class="methodname">valid</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

   }</div>


  </div>
 
  <div class="section">
   <h2 class="title">Note</h2>
   <blockquote class="note"><p><strong class="note">Nota</strong>: 
    <p class="para">
     This class permits access to methods of the inner iterator via the __call magic method.
    </p>
   </p></blockquote>
  </div>
 </div>

 



































<h2>Indice dei contenuti</h2><ul class="chunklist chunklist_reference"><li><a href="iteratoriterator.construct.php">IteratorIterator::__construct</a> — Create an iterator from anything that is traversable</li><li><a href="iteratoriterator.current.php">IteratorIterator::current</a> — Get the current value</li><li><a href="iteratoriterator.getinneriterator.php">IteratorIterator::getInnerIterator</a> — Get the inner iterator</li><li><a href="iteratoriterator.key.php">IteratorIterator::key</a> — Get the key of the current element</li><li><a href="iteratoriterator.next.php">IteratorIterator::next</a> — Forward to the next element</li><li><a href="iteratoriterator.rewind.php">IteratorIterator::rewind</a> — Rewind to the first element</li><li><a href="iteratoriterator.valid.php">IteratorIterator::valid</a> — Checks if the current element is valid</li></ul>
</div>
<?php manual_footer($setup); ?>