SplStack
SplStack::setIteratorMode
SplStack
PHP Manual

# SplStack::__construct

(PHP 5 >= 5.3.0)

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

### Descripción

SplStack::__construct ( void )

This constructs a new empty stack.

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

### Lista de parámetros

This function has no parameters.

### Valores retornados

No value is returned.

### Ejemplos

Example #1 SplStack::__construct() example

`<?php
$q = new SplStack();
$q[] = 1;
$q[] = 2;
$q[] = 3;
foreach ($q as $elem) {
echo $elem."\n";
}
?>`

El resultado del ejemplo seria:

    3
    2
    1

SplStack
SplStack::setIteratorMode
SplStack
PHP Manual