AbstractArray
abstract class AbstractArray implements ArrayInterface (View source)
This class provides an implementation of the ArrayInterface, to minimize the effort required to implement this interface
Properties
protected array | $data |
Methods
Constructs a new array object
Returns a new iterator from this array
Checks whether the specified offset exists in the array
Returns the value stored at the specified offset in the array
Sets the specified offset in the map with the given value
Removes the specified offset and its value from the map
Converts this map object to a string when the object is serialized
with serialize()
Re-constructs the object from its serialized form
Returns the number of elements contained in this array
Remove all the elements from this array object
Returns a native PHP array containing all of the elements in this array object
Returns true
if this array object contains no elements
Details
at line 33
__construct(array $data = [])
Constructs a new array object
at line 48
ArrayIterator
getIterator()
Returns a new iterator from this array
at line 60
bool
offsetExists(mixed $offset)
Checks whether the specified offset exists in the array
at line 72
mixed
offsetGet(mixed $offset)
Returns the value stored at the specified offset in the array
at line 85
offsetSet(mixed $offset, mixed $value)
Sets the specified offset in the map with the given value
at line 100
offsetUnset(mixed $offset)
Removes the specified offset and its value from the map
at line 112
string
serialize()
Converts this map object to a string when the object is serialized
with serialize()
at line 123
unserialize(string $serialized)
Re-constructs the object from its serialized form
at line 134
int
count()
Returns the number of elements contained in this array
at line 139
void
clear()
Remove all the elements from this array object
at line 144
toArray()
Returns a native PHP array containing all of the elements in this array object
at line 149
bool
isEmpty()
Returns true
if this array object contains no elements