peek() public method

Unlike {@link dequeue()}, this method does not remove the item from the queue.
public peek ( ) : mixed
return mixed item at the top of the queue
Beispiel #1
0
 public function testCanNotPeekAnEmptyQueue()
 {
     $queue = new TQueue();
     try {
         $item = $queue->peek();
     } catch (TInvalidOperationException $e) {
         return;
     }
     self::fail('An expected TInvalidOperationException was not raised');
 }