class ArrayObject extends AbstractArray implements ArrayAccess, Countable, IteratorAggregate, Serializable, Arrayable

Traits

AccessorsPart
IndexFindersPart
InsertPart
SortAssocPart

Methods

__construct(array $contents = [])

No description

array
__serialize()

No description

void
__unserialize(array $data)

No description

add(mixed ...$elements)

Adds one or more elements to that array

from AddPart
append(mixed ...$elements)

Append one or more elements onto the end of array

clear()

Resets the array

void
each(callable $callback)

Iterates the array and calls the callback function with the current item as parameter

from EachPart
flip()

Flips keys and values

getIterator()

No description

Text
join(string $glue = '')

Joins the array with a string

keys()

Returns the keys of the array

merge(mixed ...$toMerge)

Merges in other values

mergeRecursive(mixed ...$toMerge)

Merges in other values, recursively

bool
offsetExists(mixed $offset)

No description

mixed
offsetGet(mixed $offset)

No description

void
offsetSet(mixed $offset, mixed $value)

No description

void
offsetUnset(mixed $offset)

No description

mixed
pop()

Pop the element off the end of array

from PopPart
prepend(mixed ...$elements)

Prepend one or more elements to the beginning of the array

mixed
reduce(callable $callback, mixed $fallback = null)

Iterative reduction of this array or collection with the help of a callback function. The callback function takes two parameters, the first is the carry, the second the current item, with this signature: mixed callback(mixed $carry, mixed $item)

remove(mixed ...$elements)

Removes one or more elements from the array

reverse()

Reverses the order of all elements

string
serialize()

No description

mixed
shift()

Shift an element off the beginning of array

slice(int $offset, int|null $length = null, bool $preserveKeys = false)

Extract a slice of the array

splice(int $offset, int|null $length = null, array $replacement = [])

Remove a portion of the array and replace it with something else

unserialize(string $serialized)

No description

values()

Returns the values of the array

Details

at line 35
__construct(array $contents = [])

Parameters

array $contents

at line 39
array __serialize()

Return Value

array

at line 43
void __unserialize(array $data)

Parameters

array $data

Return Value

void

in AddPart at line 20
AddPart add(mixed ...$elements)

Adds one or more elements to that array

Parameters

mixed ...$elements

Return Value

AddPart

at line 90
ArrayObject append(mixed ...$elements)

Append one or more elements onto the end of array

Parameters

mixed ...$elements

Return Value

ArrayObject

at line 71
ArrayObject clear()

Resets the array

Return Value

ArrayObject

in EachPart at line 18
void each(callable $callback)

Iterates the array and calls the callback function with the current item as parameter

Parameters

callable $callback

Return Value

void

at line 227
ArrayObject flip()

Flips keys and values

Return Value

ArrayObject $this

at line 47
ArrayIterator getIterator()

Return Value

ArrayIterator

at line 152
Text join(string $glue = '')

Joins the array with a string

Parameters

string $glue Defaults to an empty string.

Return Value

Text Returns a string containing a string representation of all the array elements in the same order, with the glue string between each element.

at line 209
ArrayObject keys()

Returns the keys of the array

Return Value

ArrayObject the keys

at line 185
ArrayObject merge(mixed ...$toMerge)

Merges in other values

Parameters

mixed ...$toMerge Variable list of arrays to merge.

Return Value

ArrayObject $this

at line 198
ArrayObject mergeRecursive(mixed ...$toMerge)

Merges in other values, recursively

Parameters

mixed ...$toMerge Variable list of arrays to merge.

Return Value

ArrayObject $this

at line 258
bool offsetExists(mixed $offset)

Parameters

mixed $offset

Return Value

bool

at line 278
mixed offsetGet(mixed $offset)

Parameters

mixed $offset

Return Value

mixed

at line 245
void offsetSet(mixed $offset, mixed $value)

Parameters

mixed $offset
mixed $value

Return Value

void

at line 267
void offsetUnset(mixed $offset)

Parameters

mixed $offset

Return Value

void

in PopPart at line 18
mixed pop()

Pop the element off the end of array

Return Value

mixed the popped element

at line 103
ArrayObject prepend(mixed ...$elements)

Prepend one or more elements to the beginning of the array

Parameters

mixed ...$elements

Return Value

ArrayObject

in ReducePart at line 25
mixed reduce(callable $callback, mixed $fallback = null)

Iterative reduction of this array or collection with the help of a callback function. The callback function takes two parameters, the first is the carry, the second the current item, with this signature: mixed callback(mixed $carry, mixed $item)

Parameters

callable $callback the callback function
mixed $fallback the default value, that will be returned when the list is empty

Return Value

mixed

in RemovePart at line 20
RemovePart remove(mixed ...$elements)

Removes one or more elements from the array

Parameters

mixed ...$elements

Return Value

RemovePart

in ReversePart at line 18
ReversePart reverse()

Reverses the order of all elements

Return Value

ReversePart

at line 51
string serialize()

Return Value

string

at line 114
mixed shift()

Shift an element off the beginning of array

Return Value

mixed the shifted element

at line 174
ArrayObject slice(int $offset, int|null $length = null, bool $preserveKeys = false)

Extract a slice of the array

Parameters

int $offset
int|null $length
bool $preserveKeys

Return Value

ArrayObject

at line 129
ArrayObject splice(int $offset, int|null $length = null, array $replacement = [])

Remove a portion of the array and replace it with something else

Parameters

int $offset If offset is positive then the start of removed portion is at that offset from the beginning of the input array. If offset is negative then it starts that far from the end of the input array.
int|null $length If length is omitted, removes everything from offset to the end of the array. If length is specified and is positive, then that many elements will be removed. If length is specified and is negative then the end of the removed portion will be that many elements from the end of the array. If length is specified and is zero, no elements will be removed.
array $replacement If replacement array is specified, then the removed elements are replaced with elements from this array. If offset and length are such that nothing is removed, then the elements from the replacement array are inserted in the place specified by the offset. Note that keys in replacement array are not preserved. If replacement is just one element it is not necessary to put array() around it, unless the element is an array itself, an object or NULL.

Return Value

ArrayObject

at line 60
ArrayObject unserialize(string $serialized)

Parameters

string $serialized

Return Value

ArrayObject

at line 218
ArrayObject values()

Returns the values of the array

Return Value

ArrayObject the values