interface ArrayAccess (View source)

Interface to provide accessing objects as arrays.

Methods

bool
offsetExists(TKey $offset)

Whether a offset exists

mixed
offsetGet(TKey $offset)

Offset to retrieve

void
offsetSet(TKey $offset, TValue $value)

Offset to set

void
offsetUnset(TKey $offset)

Offset to unset

Details

bool offsetExists(TKey $offset)

Whether a offset exists

Parameters

TKey $offset

An offset to check for.

Return Value

bool

true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

mixed offsetGet(TKey $offset)

Offset to retrieve

Parameters

TKey $offset

The offset to retrieve.

Return Value

mixed

Can return all value types.

void offsetSet(TKey $offset, TValue $value)

Offset to set

Parameters

TKey $offset

The offset to assign the value to.

TValue $value

The value to set.

Return Value

void

void offsetUnset(TKey $offset)

Offset to unset

Parameters

TKey $offset

The offset to unset.

Return Value

void