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

Breadcrumb

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

function DoubleEndedQueue::peekLast

Return value

T | null the tail of this queue, or `null` if this queue is empty.

Overrides DoubleEndedQueueInterface::peekLast

1 call to DoubleEndedQueue::peekLast()
DoubleEndedQueue::lastElement in vendor/ramsey/collection/src/DoubleEndedQueue.php

File

vendor/ramsey/collection/src/DoubleEndedQueue.php, line 156

Class

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

Namespace

Ramsey\Collection

Code

public function peekLast() : mixed {
    $lastIndex = array_key_last($this->data);
    if ($lastIndex === null) {
        return null;
    }
    return $this->data[$lastIndex];
}
RSS feed
Powered by Drupal