Configurable arithmetic parser and interpreter for PHP
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Anton Smirnov 3423c751a7 In present 3 weeks ago
docs In present 3 weeks ago
src Detect missing operator 3 weeks ago
tests Detect missing operator 3 weeks ago
.gitattributes Add .gitattributes 2 months ago
.gitignore Ignore docs build results 2 months ago
.gitlab-ci.yml CI 2 months ago
CHANGELOG.md Changelog for 1.0.0 3 weeks ago
LICENSE.md License 2 months ago
README.md Changelog for 0.4.0 1 month ago
TODO.md Detect missing operator 3 weeks ago
composer.json Stable code standard 2 months ago
phpcs.xml Update code style 2 months ago
phpunit.dist.xml Import the prototype 2 months ago
psalm.xml Make parser return a structure containing required vars and funcs for the call 2 months ago

README.md

Arithmetic Parser for PHP

Packagist PHP Packagist Gitlab pipeline status Codecov

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.