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::__construct双方向リンクリストを使用して実装した新しい空のスタックを作成する

説明

SplStack::__construct() ( void )

これは、新しい空のスタックを作成します。

注意:

このメソッドは、イテレータのモードを自動的に SplDoublyLinkedList::IT_MODE_LIFO とします。

パラメータ

この関数にはパラメータはありません。

返り値

値を返しません。

例1 SplStack::__construct() の例

<?php
$q 
= new SplStack();

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

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

上の例の出力は以下となります。

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