ILIAS
release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
◀ ilDoc Overview
class.ilDclStack.php
Go to the documentation of this file.
1
<?php
2
9
class
ilDclStack
{
10
14
protected
$stack
= array();
15
16
20
public
function
push
($elem) {
21
$this->stack[] = $elem;
22
}
23
24
28
public
function
pop
() {
29
if
(!$this->
isEmpty
()) {
30
$last_index =
count
($this->stack) - 1;
31
$elem = $this->stack[$last_index];
32
unset($this->stack[$last_index]);
33
$this->stack = array_values($this->stack);
// re-index
34
return
$elem;
35
}
36
37
return
NULL;
38
}
39
40
44
public
function
top
() {
45
if
(!$this->
isEmpty
()) {
46
return
$this->stack[
count
($this->stack) - 1];
47
}
48
49
return
NULL;
50
}
51
52
56
public
function
isEmpty
() {
57
return
!(bool)
count
($this->stack);
58
}
59
60
61
public
function
reset
() {
62
$this->stack = array();
63
}
64
65
69
public
function
count
() {
70
return
count
($this->stack);
71
}
72
73
74
public
function
debug
() {
75
echo
"<pre>"
. print_r($this->stack, 1) .
"</pre>"
;
76
}
77
}
78
79
?>
ilDclStack\count
count()
Definition:
class.ilDclStack.php:69
ilDclStack\push
push($elem)
Definition:
class.ilDclStack.php:20
ilDclStack\reset
reset()
Definition:
class.ilDclStack.php:61
ilDclStack
Class ilDclStack.
Definition:
class.ilDclStack.php:9
ilDclStack\isEmpty
isEmpty()
Definition:
class.ilDclStack.php:56
ilDclStack\top
top()
Definition:
class.ilDclStack.php:44
ilDclStack\debug
debug()
Definition:
class.ilDclStack.php:74
ilDclStack\pop
pop()
Definition:
class.ilDclStack.php:28
ilDclStack\$stack
$stack
Definition:
class.ilDclStack.php:14
Modules
DataCollection
classes
Field
Formula
class.ilDclStack.php
Generated on Wed Aug 27 2025 19:00:41 for ILIAS by
1.8.13 (using
Doxyfile
)