function DoubleEndedQueueInterface::offerFirst
Inserts the specified element at the front of this queue if it is possible to do so immediately without violating capacity restrictions.
When using a capacity-restricted queue, this method is generally preferable to `addFirst()`, which can fail to insert an element only by throwing an exception.
Parameters
T $element The element to add to the front of this queue.:
Return value
bool `true` if the element was added to this queue, else `false`.
1 method overrides DoubleEndedQueueInterface::offerFirst()
- DoubleEndedQueue::offerFirst in vendor/
ramsey/ collection/ src/ DoubleEndedQueue.php - Inserts the specified element at the front of this queue if it is possible to do so immediately without violating capacity restrictions.
File
-
vendor/
ramsey/ collection/ src/ DoubleEndedQueueInterface.php, line 218
Class
- DoubleEndedQueueInterface
- A linear collection that supports element insertion and removal at both ends.
Namespace
Ramsey\CollectionCode
public function offerFirst(mixed $element) : bool;