inspirenmy/php-math-parser
Simple mathematical expression parser and calculator.
Maintainers
1.0.0
2019-02-06 04:55 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: ~4.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 8ac04a49b2efd04c7291e2a094da23ec627a51a6
- Adrean Boyadzhiev <adrean.boyadzhiev.woop@gmail.com>
This package is not auto-updated.
Last update: 2026-06-19 18:08:17 UTC
README
Simple mathematical expression parser and calculator.
Install
The recommended way to install Math is through composer.
{
"require": {
"aboyadzhiev/php-math-parser": "dev-master"
}
}
Usage
Here is an simple example of evaluation of mathematical expression
<?php $parser = new \Math\Parser(); $expression = '1 + 2 * 3 * ( 7 * 8 ) - ( 45 - 10 )'; $result = $parser->evaluate($expression); echo $result; //302
TODO
- Add unit tests.
- Add additional strategy for translation from infix to reverse polish notation
License
MIT, see LICENSE.
