ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
EvalMathStack Class Reference
+ Collaboration diagram for EvalMathStack:

Public Member Functions

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

Data Fields

array $stack = []
 
int $count = 0
 

Detailed Description

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

Member Function Documentation

◆ last()

EvalMathStack::last (   $n = 1)

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

469  {
470  if (isset($this->stack[$this->count - $n])) {
471  return $this->stack[$this->count - $n];
472  }
473  return null;
474  }

◆ pop()

EvalMathStack::pop ( )

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

460  {
461  if ($this->count > 0) {
462  $this->count--;
463  return $this->stack[$this->count];
464  }
465  return null;
466  }

◆ push()

EvalMathStack::push (   $val)

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

453  : void
454  {
455  $this->stack[$this->count] = $val;
456  $this->count++;
457  }

Field Documentation

◆ $count

int EvalMathStack::$count = 0

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

◆ $stack

array EvalMathStack::$stack = []

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


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