<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.dom.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'class.domnodelist.php',
    1 => 'DOMNodeList',
    2 => 'The DOMNodeList class',
  ),
  'up' => 
  array (
    0 => 'book.dom.php',
    1 => 'DOM',
  ),
  'prev' => 
  array (
    0 => 'domnode.wakeup.php',
    1 => 'DOMNode::__wakeup',
  ),
  'next' => 
  array (
    0 => 'domnodelist.count.php',
    1 => 'DOMNodeList::count',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/domnodelist.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.domnodelist.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.domnodelist" class="reference">
 <h1 class="title">The DOMNodeList class</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 5, PHP 7, PHP 8)</p>
 
  <div class="section" id="domnodelist.intro">
   <h2 class="title">Introduction</h2>
   <p class="simpara">
    Represents a live list of nodes.
   </p>
  </div>
 
  <div class="section" id="domnodelist.synopsis">
   <h2 class="title">Class synopsis</h2>
 

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

    
     <span class="modifier">implements</span>
      <a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a>,

     <a href="class.countable.php" class="interfacename">Countable</a> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Properties */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="modifier">readonly</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="varname"><a href="class.domnodelist.php#domnodelist.props.length">$<var class="varname">length</var></a></var>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="domnodelist.count.php" class="methodname">count</a></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="domnodelist.getiterator.php" class="methodname">getIterator</a></span>(): <span class="type"><a href="class.iterator.php" class="type Iterator">Iterator</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="domnodelist.item.php" class="methodname">item</a></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$index</code></span>): <span class="type"><span class="type"><a href="class.domelement.php" class="type DOMElement">DOMElement</a></span>|<span class="type"><a href="class.domnode.php" class="type DOMNode">DOMNode</a></span>|<span class="type"><a href="class.domnamespacenode.php" class="type DOMNameSpaceNode">DOMNameSpaceNode</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span></div>

   }</div>

 
  </div>
 

  <div class="section" id="domnodelist.props">
   <h2 class="title">Properties</h2>
   <dl>
    
     <dt id="domnodelist.props.length"><var class="varname">length</var></dt>
     <dd>
      <p class="para">
       The number of nodes in the list. The range of valid child node 
       indices is 0 to <code class="literal">length - 1</code> inclusive.
      </p>
     </dd>
    
   </dl>
  </div>

  <div class="section" id="domnodelist.changelog">
   <h2 class="title">Changelog</h2>
   <p class="para">
    <table class="doctable informaltable">
     
      <thead>
       <tr>
        <th>Version</th>
        <th>Description</th>
       </tr>

      </thead>

      <tbody class="tbody">
       <tr>
        <td>8.0.0</td>
        <td>
         <span class="classname"><strong class="classname">DOMNodeList</strong></span> implements
         <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span> now.
         Previously, <span class="interfacename"><a href="class.traversable.php" class="interfacename">Traversable</a></span> was implemented instead.
        </td>
       </tr>

       <tr>
        <td>7.2.0</td>
        <td>
         The <span class="classname"><a href="class.countable.php" class="classname">Countable</a></span> interface is implemented and 
         returns the value of the <a href="class.domnodelist.php#domnodelist.props.length" class="link">length</a> property.
        </td>
       </tr>

      </tbody>
     
    </table>

   </p>
  </div>

  <div class="section">
   <h2 class="title">Notes</h2>
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <span class="simpara">
      Nodes in the list can be accessed by array syntax.
    </span>
   </p></blockquote>
  </div>

 
  <div class="section">
   <h2 class="title">See Also</h2>
   <p class="para">
    <ul class="simplelist">
     <li><a href="http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-536297177" class="link external">&raquo;&nbsp;W3C specification of NodeList</a></li>
    </ul>
   </p>
  </div>
  

 </div>
 
 













 
<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="domnodelist.count.php">DOMNodeList::count</a> — Get number of nodes in the list</li><li><a href="domnodelist.getiterator.php">DOMNodeList::getIterator</a> — Retrieve an external iterator</li><li><a href="domnodelist.item.php">DOMNodeList::item</a> — Retrieves a node specified by index</li></ul>
</div>
<?php manual_footer($setup); ?>