Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Queue.php

function Queue::poll

Return value

T | null

Overrides QueueInterface::poll

2 calls to Queue::poll()
DoubleEndedQueue::pollFirst in vendor/ramsey/collection/src/DoubleEndedQueue.php
Queue::remove in vendor/ramsey/collection/src/Queue.php

File

vendor/ramsey/collection/src/Queue.php, line 118

Class

Queue
This class provides a basic implementation of `QueueInterface`, to minimize the effort required to implement this interface.

Namespace

Ramsey\Collection

Code

public function poll() : mixed {
    $index = array_key_first($this->data);
    if ($index === null) {
        return null;
    }
    $head = $this[$index];
    unset($this[$index]);
    return $head;
}
RSS feed
Powered by Drupal