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 119
void|mixed __unset(mixed $key)

Unsets the value at the specified key

Parameters

mixed $key

Return Value

void|mixed

Exceptions

InvalidArgumentException

at line line 142
mixed __get(mixed $key)

Returns the value at the specified key by reference

Parameters

mixed $key

Return Value

mixed

Exceptions

InvalidArgumentException

at line line 168
void append(mixed $value)

Appends the value

Parameters

mixed $value

Return Value

void

at line line 178
void asort()

Sort the entries by value

Return Value

void

at line line 188
int count()

Get the number of public properties in the ArrayObject

Return Value

int

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

Exchange the array for another one.

Parameters

array|ArrayObject $data

Return Value

array

Exceptions

InvalidArgumentException

at line line 230
array getArrayCopy()

Creates a copy of the ArrayObject.

Return Value

array

at line line 240
int getFlags()

Gets the behavior flags.

Return Value

int

at line line 250
Iterator getIterator()

Create a new iterator from an ArrayObject instance

Return Value

Iterator

at line line 262
string getIteratorClass()

Gets the iterator classname for the ArrayObject.

Return Value

string

at line line 272
void ksort()

Sort the entries by key

Return Value

void

at line line 282
void natcasesort()

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

Return Value

void

at line line 292
void natsort()

Sort entries using a "natural order" algorithm

Return Value

void

at line line 304
bool offsetExists(mixed $key)

Returns whether the requested key exists

Parameters

mixed $key

Return Value

bool

at line line 316
mixed offsetGet(mixed $key)

Returns the value at the specified key

Parameters

mixed $key

Return Value

mixed

at line line 338
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 350
void offsetUnset(mixed $key)

Unsets the value at the specified key

Parameters

mixed $key

Return Value

void

at line line 363
string serialize()

Serialize an ArrayObject

Return Value

string

at line line 375
void setFlags(int $flags)

Sets the behavior flags

Parameters

int $flags

Return Value

void

at line line 388
void setIteratorClass(string $class)

Sets the iterator classname for the ArrayObject

Parameters

string $class

Return Value

void

Exceptions

InvalidArgumentException

at line line 419
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 434
void uksort(callable $function)

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

Parameters

callable $function

Return Value

void

at line line 449
void unserialize(string $data)

Unserialize an ArrayObject

Parameters

string $data

Return Value

void