GenericArray
class GenericArray extends AbstractArray (View source)
GenericArray
represents a standard array object.
Properties
protected array | $data | The items of this array. | from AbstractArray |
Methods
Returns true
if the given offset exists in this array.
Sets the given value to the given offset in the array.
Removes the given offset and its value from the array.
Returns a serialized string representation of this array object.
Converts a serialized string representation into an instance object.
Details
in AbstractArray at line 35
__construct(array $data = [])
Constructs a new array object.
in AbstractArray at line 51
Traversable
getIterator()
Returns an iterator for this array.
in AbstractArray at line 65
bool
offsetExists(mixed $offset)
Returns true
if the given offset exists in this array.
in AbstractArray at line 80
mixed|null
offsetGet(mixed $offset)
Returns the value at the specified offset.
in AbstractArray at line 94
void
offsetSet(mixed|null $offset, mixed $value)
Sets the given value to the given offset in the array.
in AbstractArray at line 110
void
offsetUnset(mixed $offset)
Removes the given offset and its value from the array.
in AbstractArray at line 122
string
serialize()
Returns a serialized string representation of this array object.
in AbstractArray at line 134
void
unserialize(string $serialized)
Converts a serialized string representation into an instance object.
in AbstractArray at line 146
int
count()
Returns the number of items in this array.
in AbstractArray at line 154
void
clear()
Removes all items from this array.
in AbstractArray at line 164
array
toArray()
Returns a native PHP array representation of this array object.
in AbstractArray at line 174
bool
isEmpty()
Returns true
if this array is empty.