downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<SplStackSplStack::setIteratorMode>
Last updated: Thu, 26 Jun 2008

SplStack::__construct

(No version information available, might be only in CVS)

SplStack::__construct — Constructs a new stack implemented using a doubly linked list

Description

SplStack::__construct ( void )

This constructs a new empty stack.

Note: This method automatically sets the iterator mode to SplDoublyLinkedList::IT_MODE_LIFO.

Parameters

This function has no parameters.

Return Values

No value is returned.

Examples

Example #1 SplStack::__construct() example

<?php
$q
= new SplStack();

$q[] = 1;
$q[] = 2;
$q[] = 3;

foreach (
$q as $elem)  {
 echo
$elem."\n";
}
?>

The above example will output:

3
2
1



add a noteadd a note User Contributed Notes
Constructs a new stack implemented using a doubly linked list
There are no user contributed notes for this page.




<SplStackSplStack::setIteratorMode>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs