class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable (View source)

The ArrayObject class. Based on ZF2.

Constants

STD_PROP_LIST

Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).

ARRAY_AS_PROPS

Entries can be accessed as properties (read and write).

Methods

__construct(array $input = array(), int $flags = self::STD_PROP_LIST, string $iteratorClass = 'ArrayIterator')

Constructor

boolean
__isset(mixed $key)

Returns whether the requested key exists

void|mixed
__set(mixed $key, mixed $value)

Sets the value at the specified key to value

void|mixed
__unset(mixed $key)

Unsets the value at the specified key

mixed
__get(mixed $key)

Returns the value at the specified key by reference

void
append(mixed $value)

Appends the value

void
asort()

Sort the entries by value

int
count()

Get the number of public properties in the ArrayObject

array
exchangeArray(array|ArrayObject $data)

Exchange the array for another one.

array
getArrayCopy()

Creates a copy of the ArrayObject.

int
getFlags()

Gets the behavior flags.

getIterator()

Create a new iterator from an ArrayObject instance

string
getIteratorClass()

Gets the iterator classname for the ArrayObject.

void
ksort()

Sort the entries by key

void
natcasesort()

Sort an array using a case insensitive "natural order" algorithm

void
natsort()

Sort entries using a "natural order" algorithm

bool
offsetExists(mixed $key)

Returns whether the requested key exists

mixed
offsetGet(mixed $key)

Returns the value at the specified key

void
offsetSet(mixed $key, mixed $value)

Sets the value at the specified key to value

void
offsetUnset(mixed $key)

Unsets the value at the specified key

string
serialize()

Serialize an ArrayObject

void
setFlags(int $flags)

Sets the behavior flags

void
setIteratorClass(string $class)

Sets the iterator classname for the ArrayObject

void
uasort(callable $function)

Sort the entries with a user-defined comparison function and maintain key association

void
uksort(callable $function)

Sort the entries by keys using a user-defined comparison function

void
unserialize(string $data)

Unserialize an ArrayObject

Details

at line line 56
__construct(array $input = array(), int $flags = self::STD_PROP_LIST, string $iteratorClass = 'ArrayIterator')

Constructor

Parameters

array $input
int $flags
string $iteratorClass

at line line 72
boolean __isset(mixed $key)

Returns whether the requested key exists

Parameters

mixed $key

Return Value

boolean

Exceptions

InvalidArgumentException

at line line 96
void|mixed __set(mixed $key, mixed $value)

Sets the value at the specified key to value

Parameters

mixed $key
mixed $value

Return Value

void|mixed

Exceptions

InvalidArgumentException

at line line 121
void|mixed __unset(mixed $key)

Unsets the value at the specified key

Parameters

mixed $key

Return Value

void|mixed

Exceptions

InvalidArgumentException

at line line 146
mixed __get(mixed $key)

Returns the value at the specified key by reference

Parameters

mixed $key

Return Value

mixed

Exceptions

InvalidArgumentException

at line line 172
void append(mixed $value)

Appends the value

Parameters

mixed $value

Return Value

void

at line line 182
void asort()

Sort the entries by value

Return Value

void

at line line 192
int count()

Get the number of public properties in the ArrayObject

Return Value

int

at line line 205
array exchangeArray(array|ArrayObject $data)

Exchange the array for another one.

Parameters

array|ArrayObject $data

Return Value

array

Exceptions

InvalidArgumentException

at line line 234
array getArrayCopy()

Creates a copy of the ArrayObject.

Return Value

array

at line line 244
int getFlags()

Gets the behavior flags.

Return Value

int

at line line 254
Iterator getIterator()

Create a new iterator from an ArrayObject instance

Return Value

Iterator

at line line 266
string getIteratorClass()

Gets the iterator classname for the ArrayObject.

Return Value

string

at line line 276
void ksort()

Sort the entries by key

Return Value

void

at line line 286
void natcasesort()

Sort an array using a case insensitive "natural order" algorithm

Return Value

void

at line line 296
void natsort()

Sort entries using a "natural order" algorithm

Return Value

void

at line line 308
bool offsetExists(mixed $key)

Returns whether the requested key exists

Parameters

mixed $key

Return Value

bool

at line line 320
mixed offsetGet(mixed $key)

Returns the value at the specified key

Parameters

mixed $key

Return Value

mixed

at line line 342
void offsetSet(mixed $key, mixed $value)

Sets the value at the specified key to value

Parameters

mixed $key
mixed $value

Return Value

void

at line line 354
void offsetUnset(mixed $key)

Unsets the value at the specified key

Parameters

mixed $key

Return Value

void

at line line 367
string serialize()

Serialize an ArrayObject

Return Value

string

at line line 379
void setFlags(int $flags)

Sets the behavior flags

Parameters

int $flags

Return Value

void

at line line 392
void setIteratorClass(string $class)

Sets the iterator classname for the ArrayObject

Parameters

string $class

Return Value

void

Exceptions

InvalidArgumentException

at line line 423
void uasort(callable $function)

Sort the entries with a user-defined comparison function and maintain key association

Parameters

callable $function

Return Value

void

at line line 438
void uksort(callable $function)

Sort the entries by keys using a user-defined comparison function

Parameters

callable $function

Return Value

void

at line line 453
void unserialize(string $data)

Unserialize an ArrayObject

Parameters

string $data

Return Value

void