ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 442 of file class.EvalMath.php.

Member Function Documentation

◆ last()

EvalMathStack::last (   $n = 1)

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

References $n.

463  {
464  // mjansen-patch: begin
465  if (isset($this->stack[$this->count-$n])) {
466  return $this->stack[$this->count - $n];
467  }
468  return null;
469  // mjansen-patch: end
470  }
$n
Definition: RandomTest.php:85

◆ pop()

EvalMathStack::pop ( )

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

454  {
455  if ($this->count > 0) {
456  $this->count--;
457  return $this->stack[$this->count];
458  }
459  return null;
460  }

◆ push()

EvalMathStack::push (   $val)

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

448  {
449  $this->stack[$this->count] = $val;
450  $this->count++;
451  }

Field Documentation

◆ $count

EvalMathStack::$count = 0

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

◆ $stack

EvalMathStack::$stack = array()

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


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