ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 }

References $count.

◆ 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 }

References $count.

Field Documentation

◆ $count

int EvalMathStack::$count = 0

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

Referenced by pop(), and push().

◆ $stack

array EvalMathStack::$stack = []

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


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