The SplDoublyLinkedList class

Introduction

The SplDoublyLinkedList class provides the main functionalities of a doubly linked list.

Class synopsis

SplDoublyLinkedList
implements Iterator Countable ArrayAccess Serializable
/* Constants */
public const int SplDoublyLinkedList::IT_MODE_LIFO;
public const int SplDoublyLinkedList::IT_MODE_FIFO;
public const int SplDoublyLinkedList::IT_MODE_DELETE;
public const int SplDoublyLinkedList::IT_MODE_KEEP;
/* Methods */
public void add(int $index, mixed $value)
public mixed bottom()
public int count()
public mixed current()
public int getIteratorMode()
public bool isEmpty()
public int key()
public void next()
public bool offsetExists(int $index)
public mixed offsetGet(int $index)
public void offsetSet(intnull $index, mixed $value)
public void offsetUnset(int $index)
public mixed pop()
public void prev()
public void push(mixed $value)
public void rewind()
public string serialize()
public int setIteratorMode(int $mode)
public mixed shift()
public mixed top()
public void unserialize(string $data)
public void unshift(mixed $value)
public bool valid()

Predefined Constants

Iteration Direction

SplDoublyLinkedList::IT_MODE_LIFO

The list will be iterated in a last in, first out order, like a stack.

SplDoublyLinkedList::IT_MODE_FIFO

The list will be iterated in a first in, first out order, like a queue.

Iteration Behavior

SplDoublyLinkedList::IT_MODE_DELETE

Iteration will remove the iterated elements.

SplDoublyLinkedList::IT_MODE_KEEP

Iteration will not remove the iterated elements.

Table of Contents