ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
EvalMathStack Class Reference
+ Collaboration diagram for EvalMathStack:

Public Member Functions

 push ($val)
 
 pop ()
 
 last ($n=1)
 

Data Fields

 $stack = array()
 
 $count = 0
 

Detailed Description

Definition at line 396 of file class.EvalMath.php.

Member Function Documentation

◆ last()

EvalMathStack::last (   $n = 1)

Definition at line 414 of file class.EvalMath.php.

414 {
415 // mjansen-patch: begin
416 if(isset($this->stack[$this->count-$n])) {
417 return $this->stack[$this->count - $n];
418 }
419 return null;
420 // mjansen-patch: end
421 }
$n
Definition: RandomTest.php:80

References $n.

◆ pop()

EvalMathStack::pop ( )

Definition at line 406 of file class.EvalMath.php.

406 {
407 if ($this->count > 0) {
408 $this->count--;
409 return $this->stack[$this->count];
410 }
411 return null;
412 }

References $count.

◆ push()

EvalMathStack::push (   $val)

Definition at line 401 of file class.EvalMath.php.

401 {
402 $this->stack[$this->count] = $val;
403 $this->count++;
404 }

References $count.

Field Documentation

◆ $count

EvalMathStack::$count = 0

Definition at line 399 of file class.EvalMath.php.

Referenced by pop(), and push().

◆ $stack

EvalMathStack::$stack = array()

Definition at line 398 of file class.EvalMath.php.


The documentation for this class was generated from the following file: