peek() public méthode

Unlike {@link pop()}, this method does not remove the item from the stack.
public peek ( ) : mixed
Résultat mixed item at the top of the stack
Exemple #1
0
 public function testCanNotPeekAnEmptyStack()
 {
     $stack = new TStack();
     try {
         $item = $stack->peek();
     } catch (TInvalidOperationException $e) {
         return;
     }
     self::fail('An expected TInvalidOperationException was not raised');
 }