peek() public method

Unlike {@link pop()}, this method does not remove the item from the stack.
public peek ( ) : mixed
return mixed item at the top of the stack
コード例 #1
0
ファイル: TStackTest.php プロジェクト: pradosoft/prado
 public function testCanNotPeekAnEmptyStack()
 {
     $stack = new TStack();
     try {
         $item = $stack->peek();
     } catch (TInvalidOperationException $e) {
         return;
     }
     self::fail('An expected TInvalidOperationException was not raised');
 }