AbstractArray
abstract class AbstractArray implements ArrayInterface (View source)
This class provides a basic implementation of ArrayInterface
, to minimize
the effort required to implement this interface.
Properties
protected array | $data | The items of this array. |
Methods
Constructs a new array object.
Returns an iterator for this array.
Returns true
if the given offset exists in this array.
Returns the value at the specified offset.
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.
Returns the number of items in this array.
Removes all items from this array.
Returns a native PHP array representation of this array object.
Returns true
if this array is empty.
Details
at line 35
__construct(array $data = [])
Constructs a new array object.
at line 51
Traversable
getIterator()
Returns an iterator for this array.
at line 65
bool
offsetExists(mixed $offset)
Returns true
if the given offset exists in this array.
at line 80
mixed|null
offsetGet(mixed $offset)
Returns the value at the specified offset.
at line 94
void
offsetSet(mixed|null $offset, mixed $value)
Sets the given value to the given offset in the array.
at line 110
void
offsetUnset(mixed $offset)
Removes the given offset and its value from the array.
at line 122
string
serialize()
Returns a serialized string representation of this array object.
at line 134
void
unserialize(string $serialized)
Converts a serialized string representation into an instance object.
at line 146
int
count()
Returns the number of items in this array.
at line 154
void
clear()
Removes all items from this array.
at line 164
array
toArray()
Returns a native PHP array representation of this array object.
at line 174
bool
isEmpty()
Returns true
if this array is empty.