A powerful mathematical expression parser and evaluator for PHP featuring variable substitution, user-defined constants, functions, deterministic functions, macros, operators, and compiler optimizations.
GPL-3.0 License
Bot releases are hidden (Show)
Published by Muqsit about 2 years ago
BinaryOperatorRegistry
no longer ends up in an invalid state when an InvalidArgumentException
thrown by BinaryOperatorRegistry::register()
is handled3..2
, 3.2.1
, etc.) are no longer parsed as numeric literals// before
> tan(x) + tan(y) tan(z) ** tan(w)
Unexpected Function Call token encountered at "tan" (16:19) in "tan(x) + tan(y) tan(z) ** tan(w)"
// after
> tan(x) + tan(y) tan(z) ** tan(w)
Unexpected Function Call token encountered at "tan(z)" (16:22) in "tan(x) + tan(y) tan(z) ** tan(w)"
Published by Muqsit about 2 years ago
ParseException
when encountering tokens that cannot be resolved to expression tokens
,
outside fcall) where a RuntimeException
would have instead been thrown with the message "Don't know how to convert * token"Published by Muqsit about 2 years ago
BinaryOperatorRegistry
and UnaryOperatorRegistry
Published by Muqsit about 2 years ago
ParseException
when secluded tokens are encountered (such as 2 3 + 4
or tan(x) tan(y)
) instead of silently ignoringParseException
being incorrectly thrown for specific nested binary operationsParseException
Published by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
ParseException
is now thrown when a missing opening/closing parenthesis is encounteredParseException
is now thrown when no lvalue or rvalue is supplied for a binary operatorParseException
is now thrown when no rvalue is supplied for a unary operatorParseException
is now thrown when the supplied expression is emptyParseException
now extends Exception
ParseException
when Parser::parse()
is invokedPublished by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
Expression::evaluate()
Published by Muqsit about 2 years ago
ParseException
if the binary token tree is improperly formatted
2b
, b c d
, etc.Published by Muqsit about 2 years ago
var_dump()
-ing an Expression
Published by Muqsit about 2 years ago
**
) binary operator%
) binary operatorPublished by Muqsit about 2 years ago
Published by Muqsit about 2 years ago
This is the initial release of muqsit/arithmexp
.