class ArrayList implements ArrayAccess, Countable, IteratorAggregate

Provides the base class for a generic list (items can be accessed by index).

Traits

Strict class for better experience.

Methods

getIterator()

Returns an iterator over all items.

int
count()

Returns items count.

void
offsetSet($index, $value)

Replaces or appends a item.

mixed
offsetGet(int $index)

Returns a item.

bool
offsetExists(int $index)

Determines whether a item exists.

void
offsetUnset(int $index)

Removes the element at the specified position in this list.

void
prepend($value)

Prepends a item.

Details

at line 28
ArrayIterator getIterator()

Returns an iterator over all items.

Return Value

ArrayIterator

at line 37
int count()

Returns items count.

Return Value

int

at line 48
void offsetSet($index, $value)

Replaces or appends a item.

Parameters

$index
$value

Return Value

void

Exceptions

OutOfRangeException

at line 68
mixed offsetGet(int $index)

Returns a item.

Parameters

int $index

Return Value

mixed

Exceptions

OutOfRangeException

at line 81
bool offsetExists(int $index)

Determines whether a item exists.

Parameters

int $index

Return Value

bool

at line 92
void offsetUnset(int $index)

Removes the element at the specified position in this list.

Parameters

int $index

Return Value

void

Exceptions

OutOfRangeException

at line 104
void prepend($value)

Prepends a item.

Parameters

$value

Return Value

void