ArrayList
in package
implements
ArrayAccess, Countable, IteratorAggregate
Provides the base class for a generic list (items can be accessed by index).
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
Properties
- $list : array<string|int, mixed>
Methods
- count() : int
- Returns items count.
- from() : static
- Transforms array to ArrayList.
- getIterator() : Iterator<int, T>
- Returns an iterator over all items.
- offsetExists() : bool
- Determines whether an item exists.
- offsetGet() : T
- Returns an item.
- offsetSet() : void
- Replaces or appends an item.
- offsetUnset() : void
- Removes the element at the specified position in this list.
- prepend() : void
- Prepends an item.
Properties
$list
private
array<string|int, mixed>
$list
= []
Methods
count()
Returns items count.
public
count() : int
Return values
intfrom()
Transforms array to ArrayList.
public
static from(array<int, T> $array) : static
Parameters
- $array : array<int, T>
Return values
staticgetIterator()
Returns an iterator over all items.
public
& getIterator() : Iterator<int, T>
Return values
Iterator<int, T>offsetExists()
Determines whether an item exists.
public
offsetExists(int $index) : bool
Parameters
- $index : int
Return values
booloffsetGet()
Returns an item.
public
offsetGet(int $index) : T
Parameters
- $index : int
Tags
Return values
ToffsetSet()
Replaces or appends an item.
public
offsetSet(int|null $index, T $value) : void
Parameters
- $index : int|null
- $value : T
Tags
offsetUnset()
Removes the element at the specified position in this list.
public
offsetUnset(int $index) : void
Parameters
- $index : int
Tags
prepend()
Prepends an item.
public
prepend(T $value) : void
Parameters
- $value : T