ArrayObject

This ArrayObject is a rewrite of the implementation to fix issues with php's implementation of ArrayObject where you are unable to unset multi-dimensional arrays because you need to fetch the properties / lists as references.

 Methods

Constructor

__construct(array $input, int $flags, string $iteratorClass) : \Zend\Stdlib\ArrayObject\ArrayObject

Parameters

$input

array

$flags

int

$iteratorClass

string

Returns

\Zend\Stdlib\ArrayObject\ArrayObject

Returns the value at the specified key by reference

__get(mixed $key) : mixed

Parameters

$key

mixed

Returns

mixed

Returns whether the requested key exists

__isset(mixed $key) : boolean

Parameters

$key

mixed

Returns

boolean

Sets the value at the specified key to value

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

Parameters

$key

mixed

$value

mixed

Unsets the value at the specified key

__unset(mixed $key) : void

Parameters

$key

mixed

Appends the value

append(mixed $value) : void

Parameters

$value

mixed

Sort the entries by value

asort() : void

Get the number of public properties in the ArrayObject

count() : int

Returns

int

Exchange the array for another one.

exchangeArray(array | \Zend\Stdlib\ArrayObject\ArrayObject $data) : array

Parameters

$data

array\Zend\Stdlib\ArrayObject\ArrayObject

Returns

array

Creates a copy of the ArrayObject.

getArrayCopy() : array

Returns

array

Gets the behavior flags.

getFlags() : int

Returns

int

Create a new iterator from an ArrayObject instance

getIterator() : \Iterator

Returns

\Iterator

Gets the iterator classname for the ArrayObject.

getIteratorClass() : string

Returns

string

Sort the entries by key

ksort() : void

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

natcasesort() : void

Sort entries using a "natural order" algorithm

natsort() : void

Returns whether the requested key exists

offsetExists(mixed $key) : boolean

Parameters

$key

mixed

Returns

boolean

Returns the value at the specified key

offsetGet(mixed $key) : mixed

Parameters

$key

mixed

Returns

mixed

Sets the value at the specified key to value

offsetSet(mixed $key, mixed $value) : void

Parameters

$key

mixed

$value

mixed

Unsets the value at the specified key

offsetUnset(mixed $key) : void

Parameters

$key

mixed

Serialize an ArrayObject

serialize() : string

Returns

string

Sets the behavior flags

setFlags(int $flags) : void

Parameters

$flags

int

Sets the iterator classname for the ArrayObject

setIteratorClass(string $class) : void

Parameters

$class

string

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

uasort(\Zend\Stdlib\ArrayObject\callable $function) : void

Parameters

$function

\Zend\Stdlib\ArrayObject\callable

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

uksort(\Zend\Stdlib\ArrayObject\callable $function) : void

Parameters

$function

\Zend\Stdlib\ArrayObject\callable

Unserialize an ArrayObject

unserialize(string $data) : void

Parameters

$data

string

 Properties

 

$flag

$flag : int

 

$iteratorClass

$iteratorClass : string

 

$protectedProperties

$protectedProperties : array

 

$storage

$storage : array

 Constants

 

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

ARRAY_AS_PROPS 

 

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

STD_PROP_LIST