downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SplStack::setIteratorMode> <SplStack
[edit] Last updated: Fri, 25 May 2012

view this page in

SplStack::__construct

(PHP 5 >= 5.3.0)

SplStack::__constructConstruit une nouvelle pile, en utilisant une liste

Description

SplStack::__construct() ( void )

Construit une nouvelle pile vide.

Note:

Cette méthode définit automatiquement le mode de l'itérateur à SplDoublyLinkedList::IT_MODE_LIFO.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Aucune valeur n'est retournée.

Exemples

Exemple #1 Exemple avec SplStack::__construct()

<?php
$q 
= new SplStack();

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

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

L'exemple ci-dessus va afficher :

3
2
1



add a note add a note User Contributed Notes SplStack::__construct
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites