« Ds\Set::xor
Ds\Stack::allocate »

The Stack class

(PECL ds >= 1.0.0)

はじめに

A Stack is a “last in, first out” or “LIFO” collection that only allows access to the value at the top of the structure and iterates in that order, destructively.

Uses a Ds\Vector internally.

クラス概要

class Ds\Stack implements Ds\Collection, ArrayAccess {
/* メソッド */
public function allocate(int $capacity): void
public function capacity(): int
public function clear(): void
public function copy(): Ds\Stack
public function isEmpty(): bool
public function peek(): mixed
public function pop(): mixed
public function push(mixed ...$values): void
public function toArray(): array
}

変更履歴

バージョン 説明
PECL ds 1.3.0 The class now implements ArrayAccess.

目次

関連キーワード:
Stack   stack   capacity   values   allocate   copy   mixed   implements   ArrayAccess   clear   isEmpty   peek   push   toArray   Removes   Structures   last   first   collection   allows   access   structure   iterates   order   destructively
関連する関数・ページ:
ds-stack.clear   ds-stack.pop   ds-stack.peek   ds-stack.count   ds-stack.construct   ds-stack.toarray