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

Parameters

$input

array

$flags

int

$iteratorClass

string

Returns

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($key) : boolean

Parameters

$key

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 $data) : array

Parameters

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($key) : boolean

Parameters

$key

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($key) : void

Parameters

$key

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\callable $function) : void

Parameters

$function

\Zend\Stdlib\callable

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

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

Parameters

$function

\Zend\Stdlib\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 

ArrayObject

Since we need to substitute an alternate ArrayObject implementation for versions > 5.3.3, we need to provide a stub for 5.3.3. This stub simply extends the PHP ArrayObject implementation, and provides default behavior in the constructor.

 Methods

Constructor

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

Parameters

$input

array

$flags

int

$iteratorClass

string

Returns

append()

append() 

inherited_from ArrayObject::append()

asort()

asort() 

inherited_from ArrayObject::asort()

count()

count() 

inherited_from ArrayObject::count()

exchangeArray()

exchangeArray() 

inherited_from ArrayObject::exchangeArray()

getArrayCopy()

getArrayCopy() 

inherited_from ArrayObject::getArrayCopy()

getFlags()

getFlags() 

inherited_from ArrayObject::getFlags()

getIterator()

getIterator() 

inherited_from ArrayObject::getIterator()

getIteratorClass()

getIteratorClass() 

inherited_from ArrayObject::getIteratorClass()

ksort()

ksort() 

inherited_from ArrayObject::ksort()

natcasesort()

natcasesort() 

inherited_from ArrayObject::natcasesort()

natsort()

natsort() 

inherited_from ArrayObject::natsort()

offsetExists()

offsetExists() 

inherited_from ArrayObject::offsetExists()

offsetGet()

offsetGet() 

inherited_from ArrayObject::offsetGet()

offsetSet()

offsetSet() 

inherited_from ArrayObject::offsetSet()

offsetUnset()

offsetUnset() 

inherited_from ArrayObject::offsetUnset()

serialize()

serialize() 

inherited_from ArrayObject::serialize()

setFlags()

setFlags() 

inherited_from ArrayObject::setFlags()

setIteratorClass()

setIteratorClass() 

inherited_from ArrayObject::setIteratorClass()

uasort()

uasort() 

inherited_from ArrayObject::uasort()

uksort()

uksort() 

inherited_from ArrayObject::uksort()

unserialize()

unserialize() 

inherited_from ArrayObject::unserialize()