I've installed math-executor through Composer, ran some tests on the first code and came to this issue:
Code:
require "vendor/autoload.php";
$calculator = new \NXP\MathExecutor();
print $calculator->execute("1 + 2 * (2 - (4+10))^2 + sin(10)");
print $calculator->execute("(4+10)^2");
Output:
-19.544021110889
Notice: Undefined offset: -1 in C:\xampp\htdocs\math\vendor\nxp\math-executor\src\NXP\Classes\Lexer.php on line 107
Fatal error: Call to a member function getPriority() on null in C:\xampp\htdocs\math\vendor\nxp\math-executor\src\NXP\Classes\Lexer.php on line 107
How can I fix this?
I've installed math-executor through Composer, ran some tests on the first code and came to this issue:
Code:
require "vendor/autoload.php";
$calculator = new \NXP\MathExecutor();
print $calculator->execute("1 + 2 * (2 - (4+10))^2 + sin(10)");
print $calculator->execute("(4+10)^2");
Output:
-19.544021110889
Notice: Undefined offset: -1 in C:\xampp\htdocs\math\vendor\nxp\math-executor\src\NXP\Classes\Lexer.php on line 107
Fatal error: Call to a member function getPriority() on null in C:\xampp\htdocs\math\vendor\nxp\math-executor\src\NXP\Classes\Lexer.php on line 107
How can I fix this?