Commit graph

5 commits

Author SHA1 Message Date
Bruce Wells
a0ff7a79af
Adding varExists method and support for undefined var handler in getVar (#96)
* Added varExists method

* getVar now respects VarNotFoundHandler setting

* Use local version of PHP-CS-Fixer

Instead of hard coded version from github actions

* Fixing actions

* Fixing actions

* Dropping testing for 7.3, as it is no longer supported
2022-03-21 12:52:25 -04:00
franksl
29c5b5006c Logicandcompare (#50)
* TokenFactory: allowing multicharacter tokens

* Added logical and compare operators: <, <=, >, >=, ==, !=, ||, &&

* Fixed operator priorities

* Error messages fixes

* Fixed operators priority

The priorities are assigned by following the php language standard
(https://www.php.net/manual/en/language.operators.precedence.php)
I've assigned precedence in steps of 10 units by following the linked page:
230 clone new
220 **
210 ++ -- ~ (int) (float) (string) (array) (object) (bool) @
200 instanceof
190 !
180 * / %
170 + - .
160 << >>
150 < <= > >=
140 == != === !== <> <=>
130 &
120 ^
110 |
100 &&
 90 ||
 80 ??
 70 ? :
 60 = += -= *= **= /= .= %= &= |= ^= <<= >>=
 50 yield from
 40 yield
 30 and
 20 xor
 10 or

* Added if() function

* Cache key fix

There are cases where the cache key creation raised an error, for example
while evaluating the expression "if(cos(2), cos(2), 0)", because the
if() function was passing a float to the MathExecutor:execute() method.
2019-11-26 09:00:24 -05:00
Bruce Wells
ce50015732
Subtraction fix (#46)
* Updated unit tests
* Fixed docs
* Better unary minus support
2019-08-16 10:27:44 -04:00
ochi51
8d602b30dd Fixes exponentiation operator 2017-09-12 20:54:51 +09:00
NeonXP
a8bdd54346 Initial commit 2013-03-14 04:27:37 +04:00