PHP Класс Prado\Collections\TStack
TStack implements a stack.
The typical stack operations are implemented, which include
{@link push()}, {@link pop()} and {@link peek()}. In addition,
{@link contains()} can be used to check if an item is contained
in the stack. To obtain the number of the items in the stack,
check the {@link getCount Count} property.
Items in the stack may be traversed using foreach as follows,
foreach($stack as $item) ...
Показать файл
Открыть проект
Примеры использования класса
Открытые методы
Описание методов
__construct()
публичный Метод
Initializes the stack with an array or an iterable object.
Removes all items in the stack.
contains()
публичный Метод
copyFrom()
публичный Метод
Note, existing data in the list will be cleared first.
This method is required by \Countable interface.
getCount()
публичный Метод
getIterator()
публичный Метод
This method is required by the interface \IteratorAggregate.
Unlike {@link pop()}, this method does not remove the item from the stack.
Pops up the item at the top of the stack.
public pop ( ) : mixed |
Результат |
mixed |
the item at the top of the stack |
Pushes an item into the stack.
toArray()
публичный Метод