Copied!
CloneableInstantiable
Methods
public __construct(array $functions, array $operators)
 
  • todo PHP8: Use constructor property promotion -> public function __construct(private array $functions, private array $operators)
  • param array<string,\CustomFunction> $functions
  • param \Operator[] $operators
public calculate(array $tokens, array $variables, ?callable $onVarNotFound = NULL)
 

Calculate array of tokens in reverse polish notation

  • param \Token[] $tokens
  • param array<string,float|string> $variables
  • throws \UnknownVariableException
  • throws \IncorrectExpressionException
  • return int|float|string|null
Properties
private array $functions
private array $operators
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration