GenericArray
GenericArray
represents a standard array object.
- Full name:
\Ramsey\Collection\GenericArray
- Parent class:
\Ramsey\Collection\AbstractArray
Inherited methods
__construct
Constructs a new array object.
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
array |
The initial items to add to this array. |
getIterator
Returns an iterator for this array.
See Also:
- http://php.net/manual/en/iteratoraggregate.getiterator.php - IteratorAggregate::getIterator()
offsetExists
Returns true
if the given offset exists in this array.
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
array-key | The offset to check. |
See Also:
- http://php.net/manual/en/arrayaccess.offsetexists.php - ArrayAccess::offsetExists()
offsetGet
Returns the value at the specified offset.
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
array-key | The offset for which a value should be returned. |
Return Value:
the value stored at the offset, or null if the offset does not exist.
See Also:
- http://php.net/manual/en/arrayaccess.offsetget.php - ArrayAccess::offsetGet()
offsetSet
Sets the given value to the given offset in the array.
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
(array-key)|null | The offset to set. If null , the value may beset at a numerically-indexed offset. |
$value |
\Ramsey\Collection\T | The value to set at the given offset. |
See Also:
- http://php.net/manual/en/arrayaccess.offsetset.php - ArrayAccess::offsetSet()
offsetUnset
Removes the given offset and its value from the array.
Parameters:
Parameter | Type | Description |
---|---|---|
$offset |
array-key | The offset to remove from the array. |
See Also:
- http://php.net/manual/en/arrayaccess.offsetunset.php - ArrayAccess::offsetUnset()
serialize
Returns a serialized string representation of this array object.
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
Return Value:
a PHP serialized string.
See Also:
- http://php.net/manual/en/serializable.serialize.php - Serializable::serialize()
__serialize
Returns data suitable for PHP serialization.
See Also:
- https://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.serialize - * https://www.php.net/serialize -
unserialize
Converts a serialized string representation into an instance object.
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
Parameters:
Parameter | Type | Description |
---|---|---|
$serialized |
string | A PHP serialized string to unserialize. |
See Also:
- http://php.net/manual/en/serializable.unserialize.php - Serializable::unserialize()
__unserialize
Adds unserialized data to the object.
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
array |
count
Returns the number of items in this array.
See Also:
- http://php.net/manual/en/countable.count.php - Countable::count()
clear
Removes all items from this array.
toArray
Returns a native PHP array representation of this array object.
isEmpty
Returns true
if this array is empty.
Automatically generated on 2025-03-18