arokettu / arithmetic-parser
Configurable arithmetic parser and interpreter
1.1.0
2023-04-10 12:41 UTC
Requires
- php: ^8.1
- doctrine/lexer: ^2 | ^3
- php-ds/php-ds: ^1.4
Requires (Dev)
- phpunit/phpunit: ^10.0
- psy/psysh: *
- sandfox.dev/code-standard: ^1
- squizlabs/php_codesniffer: *
- vimeo/psalm: ^5.6
Suggests
- ext-ds: More efficient data structures
README
A library that can parse and interpret arithmetic expressions. It's aimed to be configurable and safe to process end user's input.
Installation
composer require 'arokettu/arithmetic-parser'
Example
<?php \Arokettu\ArithmeticParser\Calculator::evaluate('x + y', x: 2, y: 3); // 5
Documentation
Read the full documentation here: https://sandfox.dev/php/arithmetic-parser.html
Also on Read the Docs: https://php-arithmetic-parser.readthedocs.io
Support
Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/arithmetic-parser/-/issues
Feel free to ask any questions in our room on Gitter: https://gitter.im/arokettu/community
License
The library is available as open source under the terms of the MIT License.