ArithmeticOperator
class ArithmeticOperator extends BaseOperator
Defines the supported operators for arithmetic expressions.
Learn more: Supported arithmetic operators
Methods
__construct($operator)
BaseOperator constructor.
__toString()
Serializes to string.
jsonSerialize()
Serializes to json.
add()
Add
plus()
Alias for ArithmeticOperator::add.
subtract()
Subtract
minus()
Alias for ArithmeticOperator::subtract.
multiply()
Multiply
divide()
Divide
modulo()
Modulo (remainder)
power()
Power (to the power of)
Details
__construct($operator)
BaseOperator constructor.
string
__toString()
Serializes to string.
mixed
jsonSerialize()
Serializes to json.
static ArithmeticOperator
add()
Add
'+'
static ArithmeticOperator
plus()
Alias for ArithmeticOperator::add.
+
static ArithmeticOperator
subtract()
Subtract
-
static ArithmeticOperator
minus()
Alias for ArithmeticOperator::subtract.
-
static ArithmeticOperator
multiply()
Multiply
*
static ArithmeticOperator
divide()
Divide
/
static ArithmeticOperator
modulo()
Modulo (remainder)
%
static ArithmeticOperator
power()
Power (to the power of)
^
Constants
ADD |
|
SUBTRACT |
|
MULTIPLY |
|
DIVIDE |
|
MODULO |
|
POWER |
|