ILIAS  trunk Revision v5.2.0beta1-34132-g2d4d73d4a0
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 453 of file class.EvalMath.php.

Member Function Documentation

◆ last()

EvalMathStack::last (   $n = 1)

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

474  {
475  if (isset($this->stack[$this->count - $n])) {
476  return $this->stack[$this->count - $n];
477  }
478  return null;
479  }

◆ pop()

EvalMathStack::pop ( )

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

465  {
466  if ($this->count > 0) {
467  $this->count--;
468  return $this->stack[$this->count];
469  }
470  return null;
471  }

◆ push()

EvalMathStack::push (   $val)

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

458  : void
459  {
460  $this->stack[$this->count] = $val;
461  $this->count++;
462  }

Field Documentation

◆ $count

int EvalMathStack::$count = 0

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

◆ $stack

array EvalMathStack::$stack = []

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


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