class Stack implements Countable, IteratorAggregate, ArrayRepresentation (View source)

Stack container implementation

Methods

__construct()

No description

count()

No description

array
getArrayCopy()

No description

getIterator()

No description

boolean
isEmpty()

Indicates if the stack is empty

mixed
top()

Get the top-most element of the stack

push(mixed $element)

Push an element on top of the stack

mixed
pop()

Remove the top-most element of the stack

mixed
__invoke()

Invoke the top-most element of the stack

__call(string $name, array $arguments)

Attempt to call the given method on the top-most object of the stack

mixed|array|ArrayAccess|Traversable
__get(string $member)

Attempt to get the given property of the top-most element of the stack

mixed
__set(string $member, mixed $value)

Attempt to set the value of the given property of hte top most element of the stack.

Details

__construct()

count()

array getArrayCopy()

Return Value

array Array representation of the class instance

getIterator()

boolean isEmpty()

Indicates if the stack is empty

Return Value

boolean true if the stack does not contain any element

mixed top()

Get the top-most element of the stack

Return Value

mixed The top-most element of the stack

Exceptions

UnderflowException

Stack push(mixed $element)

Push an element on top of the stack

Parameters

mixed $element Element to add

Return Value

Stack the stack object

mixed pop()

Remove the top-most element of the stack

Return Value

mixed the removed element

Exceptions

UnderflowException

mixed __invoke()

Invoke the top-most element of the stack

Return Value

mixed

Exceptions

UnexpectedValueException

__call(string $name, array $arguments)

Attempt to call the given method on the top-most object of the stack

Parameters

string $name
array $arguments

Exceptions

UnexpectedValueException
BadMethodCallException

mixed|array|ArrayAccess|Traversable __get(string $member)

Attempt to get the given property of the top-most element of the stack

Parameters

string $member Array key or object property

Return Value

mixed|array|ArrayAccess|Traversable

Exceptions

InvalidArgumentException

mixed __set(string $member, mixed $value)

Attempt to set the value of the given property of hte top most element of the stack.

Parameters

string $member Array key or object property
mixed $value

Return Value

mixed

Exceptions

InvalidArgumentException