function Queue::peek
Return value
T | null
Overrides QueueInterface::peek
2 calls to Queue::peek()
- DoubleEndedQueue::peekFirst in vendor/
ramsey/ collection/ src/ DoubleEndedQueue.php - Queue::element in vendor/
ramsey/ collection/ src/ Queue.php
File
-
vendor/
ramsey/ collection/ src/ Queue.php, line 104
Class
- Queue
- This class provides a basic implementation of `QueueInterface`, to minimize the effort required to implement this interface.
Namespace
Ramsey\CollectionCode
public function peek() : mixed {
$index = array_key_first($this->data);
if ($index === null) {
return null;
}
return $this[$index];
}