function QueueInterface::offer
Inserts the specified element into 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 `add()`, which can fail to insert an element only by throwing an exception.
Parameters
T $element The element to add to this queue.:
Return value
bool `true` if the element was added to this queue, else `false`.
See also
1 method overrides QueueInterface::offer()
- Queue::offer in vendor/
ramsey/ collection/ src/ Queue.php - Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.
File
-
vendor/
ramsey/ collection/ src/ QueueInterface.php, line 162
Class
- QueueInterface
- A queue is a collection in which the entities in the collection are kept in order.
Namespace
Ramsey\CollectionCode
public function offer(mixed $element) : bool;