SplStack
class SplStack extends SplDoublyLinkedList (View source)
Constants
IT_MODE_LIFO |
|
IT_MODE_FIFO |
|
IT_MODE_DELETE |
|
IT_MODE_KEEP |
|
Methods
Add/insert a new value at the specified index
Pushes an element at the end of the doubly linked list
Prepends the doubly linked list with an element
Peeks at the node from the beginning of the doubly linked list
Sets the mode of iteration
Returns whether the requested $index exists
Sets the value at the specified $index to $newval
Details
void
add(mixed $index, TValue $value)
Add/insert a new value at the specified index
mixed
pop()
Pops a node from the end of the doubly linked list
mixed
shift()
Shifts a node from the beginning of the doubly linked list
void
push(TValue $value)
Pushes an element at the end of the doubly linked list
void
unshift(TValue $value)
Prepends the doubly linked list with an element
mixed
top()
Peeks at the node from the end of the doubly linked list
mixed
bottom()
Peeks at the node from the beginning of the doubly linked list
int
count()
Counts the number of elements in the doubly linked list.
bool
isEmpty()
Checks whether the doubly linked list is empty.
int
setIteratorMode(int $mode)
Sets the mode of iteration
int
getIteratorMode()
Returns the mode of iteration
bool
offsetExists(mixed $index)
Returns whether the requested $index exists
mixed
offsetGet(mixed $index)
Returns the value at the specified $index
void
offsetSet(mixed $index, TValue $value)
Sets the value at the specified $index to $newval
void
offsetUnset(mixed $index)
Unsets the value at the specified $index
void
rewind()
Rewind iterator back to the start
mixed
current()
Return current array entry
mixed
key()
Return current node index
void
next()
Move to next entry
void
prev()
Move to previous entry
bool
valid()
Check whether the doubly linked list contains more nodes
void
unserialize(string $data)
Unserializes the storage
string|null
serialize()
Serializes the storage
array
__debugInfo()
No description
array
__serialize()
No description
void
__unserialize(array $data)
No description