Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
EvalMath Class Reference

Public Member Functions

 __construct ($allowconstants=false, $allowimplicitmultiplication=false)
 
 e ($expr)
 
 EvalMath ($allowconstants=false, $allowimplicitmultiplication=false)
 Old syntax of class constructor.
 
 evaluate ($expr)
 
 funcs ()
 
 get_native_function_name ($fnn)
 
 nfx ($expr)
 
 pfx ($tokens, $vars=array())
 
 trigger ($msg)
 
 vars ()
 

Static Public Member Functions

static is_valid_var_or_func_name ($name)
 

Public Attributes

 $allowimplicitmultiplication
 
 $f = array()
 
 $fb
 
 $fc
 
 $fcsynonyms = array('if' => 'ifthenelse', 'and' => 'cond_and', 'or' => 'cond_or')
 
 $last_error = null
 
 $suppress_errors = false
 
 $v = array()
 
 $vb = array()
 

Member Function Documentation

◆ EvalMath()

EvalMath::EvalMath ( $allowconstants = false,
$allowimplicitmultiplication = false )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated
since Moodle 3.1

◆ get_native_function_name()

EvalMath::get_native_function_name ( $fnn)
Parameters
string$fnn
Return values
string|booleanfalse if function name unknown.

◆ is_valid_var_or_func_name()

static EvalMath::is_valid_var_or_func_name ( $name)
static
Parameters
string$name
Return values
booleanIs this a valid var or function name?

Member Data Documentation

◆ $fb

EvalMath::$fb
Initial value:
= array(
'sin','sinh','arcsin','asin','arcsinh','asinh',
'cos','cosh','arccos','acos','arccosh','acosh',
'tan','tanh','arctan','atan','arctanh','atanh',
'sqrt','abs','ln','log','exp','floor','ceil')

◆ $fc

EvalMath::$fc
Initial value:
= array(
'average'=>array(-1), 'max'=>array(-1), 'min'=>array(-1),
'mod'=>array(2), 'pi'=>array(0), 'power'=>array(2),
'round'=>array(1, 2), 'sum'=>array(-1), 'rand_int'=>array(2),
'rand_float'=>array(0), 'ifthenelse'=>array(3), 'cond_and'=>array(-1), 'cond_or'=>array(-1))

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