ArrayHash
extends stdClass
in package
implements
ArrayAccess, Countable, IteratorAggregate
Provides objects to work as array.
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
Methods
- count() : int
- Returns items count.
- from() : static
- Transforms array to ArrayHash.
- getIterator() : Iterator<string|int, T>
- Returns an iterator over all items.
- offsetExists() : bool
- Determines whether a item exists.
- offsetGet() : T
- Returns a item.
- offsetSet() : void
- Replaces or appends a item.
- offsetUnset() : void
- Removes the element from this list.
Methods
count()
Returns items count.
public
count() : int
Return values
intfrom()
Transforms array to ArrayHash.
public
static from(array<string|int, T> $array[, bool $recursive = true ]) : static
Parameters
- $array : array<string|int, T>
- $recursive : bool = true
Return values
staticgetIterator()
Returns an iterator over all items.
public
& getIterator() : Iterator<string|int, T>
Return values
Iterator<string|int, T>offsetExists()
Determines whether a item exists.
public
offsetExists(string|int $key) : bool
Parameters
- $key : string|int
Return values
booloffsetGet()
Returns a item.
public
offsetGet(string|int $key) : T
Parameters
- $key : string|int
Attributes
- #[ReturnTypeWillChange]
Return values
ToffsetSet()
Replaces or appends a item.
public
offsetSet(string|int $key, T $value) : void
Parameters
- $key : string|int
- $value : T
offsetUnset()
Removes the element from this list.
public
offsetUnset(string|int $key) : void
Parameters
- $key : string|int