ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CyclicReferenceStack.php
Go to the documentation of this file.
1<?php
2
4
6{
12 private $stack = [];
13
19 public function count()
20 {
21 return count($this->stack);
22 }
23
29 public function push($value): void
30 {
31 $this->stack[$value] = $value;
32 }
33
39 public function pop()
40 {
41 return array_pop($this->stack);
42 }
43
51 public function onStack($value)
52 {
53 return isset($this->stack[$value]);
54 }
55
59 public function clear(): void
60 {
61 $this->stack = [];
62 }
63
69 public function showStack()
70 {
71 return $this->stack;
72 }
73}
An exception for terminatinating execution or to throw for unit testing.
onStack($value)
Test to see if a specified entry exists on the stack.