function AbstractArray::offsetSet
Sets the given value to the given offset in the array.
@link http://php.net/manual/en/arrayaccess.offsetset.php ArrayAccess::offsetSet()
Parameters
array-key | null $offset The offset to set. If `null`, the value: may be set at a numerically-indexed offset.
T $value The value to set at the given offset.:
3 methods override AbstractArray::offsetSet()
- AbstractCollection::offsetSet in vendor/
ramsey/ collection/ src/ AbstractCollection.php - AbstractMap::offsetSet in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php - @inheritDoc @psalm-suppress MoreSpecificImplementedParamType,DocblockTypeContradiction
- Queue::offsetSet in vendor/
ramsey/ collection/ src/ Queue.php - Since arbitrary offsets may not be manipulated in a queue, this method serves only to fulfill the `ArrayAccess` interface requirements. It is invoked by other operations when adding values to the queue.
File
-
vendor/
ramsey/ collection/ src/ AbstractArray.php, line 100
Class
- AbstractArray
- This class provides a basic implementation of `ArrayInterface`, to minimize the effort required to implement this interface.
Namespace
Ramsey\CollectionCode
public function offsetSet(mixed $offset, mixed $value) : void {
if ($offset === null) {
$this->data[] = $value;
}
else {
$this->data[$offset] = $value;
}
}