Documentation

ArrayAccessTrait

ArrayAccess Object Trait

Table of Contents

Methods

offsetExists()  : bool
Whether or not an offset exists.
offsetGet()  : mixed
Returns the value at specified offset.
offsetSet()  : void
Assigns a value to the specified offset.
offsetUnset()  : void
Unsets an offset.

Methods

offsetExists()

Whether or not an offset exists.

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed

An offset to check for.

Attributes
#[ReturnTypeWillChange]
Return values
bool

Returns TRUE on success or FALSE on failure.

offsetGet()

Returns the value at specified offset.

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

The offset to retrieve.

Attributes
#[ReturnTypeWillChange]
Return values
mixed

Can return all value types.

offsetSet()

Assigns a value to the specified offset.

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed

The offset to assign the value to.

$value : mixed

The value to set.

Attributes
#[ReturnTypeWillChange]

offsetUnset()

Unsets an offset.

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

The offset to unset.

Attributes
#[ReturnTypeWillChange]

        
On this page

Search results