ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 469 of file class.EvalMath.php.

Member Function Documentation

◆ last()

EvalMathStack::last (   $n = 1)

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

490 {
491 if (isset($this->stack[$this->count - $n])) {
492 return $this->stack[$this->count - $n];
493 }
494 return null;
495 }

◆ pop()

EvalMathStack::pop ( )

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

481 {
482 if ($this->count > 0) {
483 $this->count--;
484 return $this->stack[$this->count];
485 }
486 return null;
487 }

References $count.

◆ push()

EvalMathStack::push (   $val)

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

474 : void
475 {
476 $this->stack[$this->count] = $val;
477 $this->count++;
478 }

References $count.

Field Documentation

◆ $count

int EvalMathStack::$count = 0

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

Referenced by pop(), and push().

◆ $stack

array EvalMathStack::$stack = []

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


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