<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'class.traversable.php',
    1 => 'Traversable',
    2 => 'The Traversable interface',
  ),
  'up' => 
  array (
    0 => 'reserved.interfaces.php',
    1 => 'Predefined Interfaces and Classes',
  ),
  'prev' => 
  array (
    0 => 'reserved.interfaces.php',
    1 => 'Predefined Interfaces and Classes',
  ),
  'next' => 
  array (
    0 => 'class.iterator.php',
    1 => 'Iterator',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/predefined/traversable.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

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

 <h1 class="title">The <span class="interfacename"><a href="class.traversable.php" class="interfacename">Traversable</a></span> interface</h1>
 

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


  <div class="section" id="traversable.intro">
   <h2 class="title">Вступ</h2>
   <p class="para">
    Interface to detect if a class is traversable using <a href="control-structures.foreach.php" class="link">foreach</a>.
   </p>
   <p class="para">
    Abstract base interface that cannot be implemented alone. Instead, it must
    be implemented by either <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span> or
    <span class="interfacename"><a href="class.iterator.php" class="interfacename">Iterator</a></span>.
   </p>
  </div>


  <div class="section" id="traversable.synopsis">
   <h2 class="title">Короткий огляд iнтерфейcу</h2>


   <div class="classsynopsis"><div class="classsynopsisinfo">
    
     <span class="modifier">interface</span> <strong class="interfacename"><strong class="interfacename">Traversable</strong></strong> {</div>
   }</div>


   <p class="para">
    This interface has no methods, its only purpose is to be the base
    interface for all traversable classes.
   </p>

  </div>

  <div class="section">
   <h2 class="title">Журнал змін</h2>
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Версія</th>
       <th>Опис</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>7.4.0</td>
       <td>
        The <span class="interfacename"><strong class="interfacename">Traversable</strong></span> interface can now be implemented
        by abstract classes. Extending classes must implement
        <span class="interfacename"><a href="class.iterator.php" class="interfacename">Iterator</a></span> or
        <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </div>

  <div class="section">
   <h2 class="title">Примітки</h2>
   <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
    <p class="para">
     Internal (built-in) classes that implement this interface can be used in
     a <a href="control-structures.foreach.php" class="link">foreach</a> construct and do not need to implement
     <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span> or
     <span class="interfacename"><a href="class.iterator.php" class="interfacename">Iterator</a></span>.
    </p>
   </p></blockquote>
   <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
    <p class="para">
     Prior to PHP 7.4.0, this internal engine interface couldn&#039;t be implemented
     in PHP scripts. Either <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span>
     or <span class="interfacename"><a href="class.iterator.php" class="interfacename">Iterator</a></span> must be used instead.
    </p>
   </p></blockquote>
  </div>

 </div>

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