dolibarr  19.0.0-dev
Public Member Functions | Private Member Functions | List of all members
EvalMath Class Reference

Class EvalMath. More...

Public Member Functions

 __construct ()
 Constructor.
 
 e ($expr)
 Evaluate. More...
 
 evaluate ($expr)
 Evaluate. More...
 
 vars ()
 Function vars. More...
 
 trigger ($code, $msg, $info=null)
 trigger an error, but nicely, if need be More...
 

Private Member Functions

 funcs ()
 Function funcs. More...
 
 nfx ($expr)
 Convert infix to postfix notation. More...
 
 pfx ($tokens, $vars=array())
 Evaluate postfix notation. More...
 

Detailed Description

Class EvalMath.

Definition at line 97 of file evalmath.class.php.

Member Function Documentation

◆ e()

EvalMath::e (   $expr)

Evaluate.

Parameters
string$exprString
Returns
boolean|number|NULL|mixed Result

Definition at line 135 of file evalmath.class.php.

References evaluate().

◆ evaluate()

EvalMath::evaluate (   $expr)

Evaluate.

Parameters
string$exprString
Returns
boolean|number|NULL|mixed Result

Definition at line 146 of file evalmath.class.php.

References trigger().

Referenced by e().

◆ funcs()

EvalMath::funcs ( )
private

Function funcs.

Returns
array Output

Definition at line 218 of file evalmath.class.php.

◆ nfx()

EvalMath::nfx (   $expr)
private

Convert infix to postfix notation.

Parameters
string$exprExpression
Returns
boolean|array Output

Definition at line 235 of file evalmath.class.php.

◆ pfx()

EvalMath::pfx (   $tokens,
  $vars = array() 
)
private

Evaluate postfix notation.

Parameters
array$tokensExpression
array$varsArray
Returns
string Output

Definition at line 381 of file evalmath.class.php.

◆ trigger()

EvalMath::trigger (   $code,
  $msg,
  $info = null 
)

trigger an error, but nicely, if need be

Parameters
string$codeCode
string$msgMsg
string | null$infoString
Returns
boolean False

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

Referenced by evaluate().

◆ vars()

EvalMath::vars ( )

Function vars.

Returns
array Output

Definition at line 205 of file evalmath.class.php.


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