The Stack class

はじめに

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.

クラス概要

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

変更履歴

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

目次