Snaju Inception Docs

Stack

Class Stack

Table of Contents

$data  : array<string|int, mixed>
__construct()  : mixed
clear()  : void
Removes all the items from the stack and resets it.
count()  : int
Retrieve the total number of items in the stack.
empty()  : void
Alias of clear method.
isEmpty()  : bool
Returns true if the stack is empty, false otherwise.
peek()  : mixed
Retrieves the next item in the stack without removing it.
pop()  : mixed
push()  : void
Adds an object to the stack.
toArray()  : array<string|int, mixed>
Retrieve the list of objects and return as an array.

Properties

$data

protected array<string|int, mixed> $data

Methods

__construct()

public __construct() : mixed
Return values
mixed

clear()

Removes all the items from the stack and resets it.

public clear() : void
Return values
void

count()

Retrieve the total number of items in the stack.

public count() : int
Return values
int

empty()

Alias of clear method.

public empty() : void
Return values
void

isEmpty()

Returns true if the stack is empty, false otherwise.

public isEmpty() : bool
Return values
bool

peek()

Retrieves the next item in the stack without removing it.

public peek() : mixed
Return values
mixed

pop()

public pop() : mixed
Return values
mixed

push()

Adds an object to the stack.

public push( $object) : void
Parameters
$object :
Return values
void

toArray()

Retrieve the list of objects and return as an array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results