<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Sets the mode of iteration</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="spldoublylinkedlist.serialize.html">SplDoublyLinkedList::serialize</a></div> <div class="next" style="text-align: right; float: right;"><a href="spldoublylinkedlist.shift.html">SplDoublyLinkedList::shift</a></div> <div class="up"><a href="class.spldoublylinkedlist.html">SplDoublyLinkedList</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="spldoublylinkedlist.setiteratormode" class="refentry"> <div class="refnamediv"> <h1 class="refname">SplDoublyLinkedList::setIteratorMode</h1> <p class="verinfo">(PHP 5 >= 5.3.0)</p><p class="refpurpose"><span class="refname">SplDoublyLinkedList::setIteratorMode</span> — <span class="dc-title">Sets the mode of iteration</span></p> </div> <div class="refsect1 description" id="refsect1-spldoublylinkedlist.setiteratormode-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>SplDoublyLinkedList::setIteratorMode</strong></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span> )</div> </div> <div class="refsect1 parameters" id="refsect1-spldoublylinkedlist.setiteratormode-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">mode</code></em></span> <dd> <p class="para"> There are two orthogonal sets of modes that can be set: </p> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara">The direction of the iteration (either one or the other):</span> <ul class="itemizedlist"> <li class="listitem"><span class="simpara"><strong><code>SplDoublyLinkedList::IT_MODE_LIFO</code></strong> (Stack style)</span></li> <li class="listitem"><span class="simpara"><strong><code>SplDoublyLinkedList::IT_MODE_FIFO</code></strong> (Queue style)</span></li> </ul> </li> <li class="listitem"> <span class="simpara">The behavior of the iterator (either one or the other):</span> <ul class="itemizedlist"> <li class="listitem"><span class="simpara"><strong><code>SplDoublyLinkedList::IT_MODE_DELETE</code></strong> (Elements are deleted by the iterator)</span></li> <li class="listitem"><span class="simpara"><strong><code>SplDoublyLinkedList::IT_MODE_KEEP</code></strong> (Elements are traversed by the iterator)</span></li> </ul> </li> </ul> <p class="para"> The default mode is: <strong><code>SplDoublyLinkedList::IT_MODE_FIFO</code></strong> | <strong><code>SplDoublyLinkedList::IT_MODE_KEEP</code></strong> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-spldoublylinkedlist.setiteratormode-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> No value is returned. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="spldoublylinkedlist.serialize.html">SplDoublyLinkedList::serialize</a></div> <div class="next" style="text-align: right; float: right;"><a href="spldoublylinkedlist.shift.html">SplDoublyLinkedList::shift</a></div> <div class="up"><a href="class.spldoublylinkedlist.html">SplDoublyLinkedList</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>