<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.ds.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'class.ds-collection.php',
    1 => 'Ds\\Collection',
    2 => 'The Collection interface',
  ),
  'up' => 
  array (
    0 => 'book.ds.php',
    1 => 'Data Structures',
  ),
  'prev' => 
  array (
    0 => 'ds.examples.php',
    1 => 'Examples',
  ),
  'next' => 
  array (
    0 => 'ds-collection.clear.php',
    1 => 'Ds\\Collection::clear',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ds/ds.collection.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.ds-collection.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.ds-collection" class="reference">

 <h1 class="title">The Collection interface</h1>
 

 <div class="partintro"><p class="verinfo">(PECL ds &gt;= 1.0.0)</p>


  <div class="section" id="ds-collection.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    <span class="classname"><strong class="classname">Collection</strong></span> is the base interface which covers functionality
    common to all the data structures in this library. It guarantees that all structures
    are traversable, countable, and can be converted to json using <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span>.
   </p>
  </div>


  <div class="section" id="ds-collection.synopsis">
   <h2 class="title">Interface synopsis</h2>


   <div class="classsynopsis"><div class="classsynopsisinfo">
    <span class="modifier">interface</span> <strong class="interfacename"><strong class="interfacename">Ds\Collection</strong></strong>

    <span class="modifier">extends</span>
      <a href="class.countable.php" class="interfacename">Countable</a>,
     <a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a>,
     <a href="class.jsonserializable.php" class="interfacename">JsonSerializable</a> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="ds-collection.clear.php" class="methodname">clear</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="ds-collection.copy.php" class="methodname">copy</a></span>(): <span class="type"><a href="class.ds-collection.php" class="type Ds\Collection">Ds\Collection</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-collection.isempty.php" class="methodname">isEmpty</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="ds-collection.toarray.php" class="methodname">toArray</a></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited methods */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="countable.count.php" class="methodname">Countable::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="iteratoraggregate.getiterator.php" class="methodname">IteratorAggregate::getIterator</a></span>(): <span class="type"><a href="class.traversable.php" class="type Traversable">Traversable</a></span></div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="jsonserializable.jsonserialize.php" class="methodname">JsonSerializable::jsonSerialize</a></span>(): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>


   }</div>


  </div>

  <div class="section">
   <h2 class="title">Changelog</h2>
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL ds 1.4.0</td>
       <td>
        <span class="classname"><strong class="classname">Collection</strong></span> implements
        <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span> now instead of just <span class="interfacename"><a href="class.traversable.php" class="interfacename">Traversable</a></span>. (This change came to the polyfill in 1.4.1.)
       </td>
      </tr>

     </tbody>
    
   </table>

  </div>

 </div>

 




























<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="ds-collection.clear.php">Ds\Collection::clear</a> — Removes all values</li><li><a href="ds-collection.copy.php">Ds\Collection::copy</a> — Returns a shallow copy of the collection</li><li><a href="ds-collection.isempty.php">Ds\Collection::isEmpty</a> — Returns whether the collection is empty</li><li><a href="ds-collection.toarray.php">Ds\Collection::toArray</a> — Converts the collection to an array</li></ul>
</div>
<?php manual_footer($setup); ?>