ArrayObject
in package
implements
IteratorAggregate, ArrayAccess, Serializable, Countable
Custom framework ArrayObject implementation
Extends version-specific "abstract" implementation.
Interfaces, Classes, Traits and Enums
- IteratorAggregate
- ArrayAccess
- Serializable
- Countable
Table of Contents
- ARRAY_AS_PROPS = 2
- Entries can be accessed as properties (read and write).
- STD_PROP_LIST = 1
- Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).
- $flag : int
- $iteratorClass : string
- $protectedProperties : array<string|int, mixed>
- $storage : array<string|int, mixed>
- __construct() : mixed
- Constructor
- __get() : mixed
- Returns the value at the specified key by reference
- __isset() : bool
- Returns whether the requested key exists
- __set() : void
- Sets the value at the specified key to value
- __unset() : void
- Unsets the value at the specified key
- append() : void
- Appends the value
- asort() : void
- Sort the entries by value
- count() : int
- Get the number of public properties in the ArrayObject
- exchangeArray() : array<string|int, mixed>
- Exchange the array for another one.
- getArrayCopy() : array<string|int, mixed>
- Creates a copy of the ArrayObject.
- getFlags() : int
- Gets the behavior flags.
- getIterator() : Iterator
- Create a new iterator from an ArrayObject instance
- getIteratorClass() : string
- Gets the iterator classname for the ArrayObject.
- ksort() : void
- Sort the entries by key
- natcasesort() : void
- Sort an array using a case insensitive "natural order" algorithm
- natsort() : void
- Sort entries using a "natural order" algorithm
- offsetExists() : bool
- Returns whether the requested key exists
- offsetGet() : mixed
- Returns the value at the specified key
- offsetSet() : void
- Sets the value at the specified key to value
- offsetUnset() : void
- Unsets the value at the specified key
- serialize() : string
- Serialize an ArrayObject
- setFlags() : void
- Sets the behavior flags
- setIteratorClass() : void
- Sets the iterator classname for the ArrayObject
- uasort() : void
- Sort the entries with a user-defined comparison function and maintain key association
- uksort() : void
- Sort the entries by keys using a user-defined comparison function
- unserialize() : void
- Unserialize an ArrayObject
Constants
ARRAY_AS_PROPS
Entries can be accessed as properties (read and write).
public
mixed
ARRAY_AS_PROPS
= 2
STD_PROP_LIST
Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).
public
mixed
STD_PROP_LIST
= 1
Properties
$flag
protected
int
$flag
$iteratorClass
protected
string
$iteratorClass
$protectedProperties
protected
array<string|int, mixed>
$protectedProperties
$storage
protected
array<string|int, mixed>
$storage
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed> $input = [] ][, int $flags = self::STD_PROP_LIST ][, string $iteratorClass = 'ArrayIterator' ]) : mixed
Parameters
- $input : array<string|int, mixed> = []
- $flags : int = self::STD_PROP_LIST
- $iteratorClass : string = 'ArrayIterator'
Return values
mixed —__get()
Returns the value at the specified key by reference
public
& __get(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —__isset()
Returns whether the requested key exists
public
__isset(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —__set()
Sets the value at the specified key to value
public
__set(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
Return values
void —__unset()
Unsets the value at the specified key
public
__unset(mixed $key) : void
Parameters
- $key : mixed
Return values
void —append()
Appends the value
public
append(mixed $value) : void
Parameters
- $value : mixed
Return values
void —asort()
Sort the entries by value
public
asort() : void
Return values
void —count()
Get the number of public properties in the ArrayObject
public
count() : int
Return values
int —exchangeArray()
Exchange the array for another one.
public
exchangeArray(array<string|int, mixed>|ArrayObject $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>|ArrayObject
Return values
array<string|int, mixed> —getArrayCopy()
Creates a copy of the ArrayObject.
public
getArrayCopy() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFlags()
Gets the behavior flags.
public
getFlags() : int
Return values
int —getIterator()
Create a new iterator from an ArrayObject instance
public
getIterator() : Iterator
Return values
Iterator —getIteratorClass()
Gets the iterator classname for the ArrayObject.
public
getIteratorClass() : string
Return values
string —ksort()
Sort the entries by key
public
ksort() : void
Return values
void —natcasesort()
Sort an array using a case insensitive "natural order" algorithm
public
natcasesort() : void
Return values
void —natsort()
Sort entries using a "natural order" algorithm
public
natsort() : void
Return values
void —offsetExists()
Returns whether the requested key exists
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —offsetGet()
Returns the value at the specified key
public
& offsetGet(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —offsetSet()
Sets the value at the specified key to value
public
offsetSet(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
Return values
void —offsetUnset()
Unsets the value at the specified key
public
offsetUnset(mixed $key) : void
Parameters
- $key : mixed
Return values
void —serialize()
Serialize an ArrayObject
public
serialize() : string
Return values
string —setFlags()
Sets the behavior flags
public
setFlags(int $flags) : void
Parameters
- $flags : int
Return values
void —setIteratorClass()
Sets the iterator classname for the ArrayObject
public
setIteratorClass(string $class) : void
Parameters
- $class : string
Return values
void —uasort()
Sort the entries with a user-defined comparison function and maintain key association
public
uasort(callable $function) : void
Parameters
- $function : callable
Return values
void —uksort()
Sort the entries by keys using a user-defined comparison function
public
uksort(callable $function) : void
Parameters
- $function : callable
Return values
void —unserialize()
Unserialize an ArrayObject
public
unserialize(string $data) : void
Parameters
- $data : string