Configurable arithmetic parser and interpreter for PHP
Go to file
Anton Smirnov 2573f8d525 Document changes and add changelog for 1.1.0 2023-04-10 15:41:58 +03:00
docs Document changes and add changelog for 1.1.0 2023-04-10 15:41:58 +03:00
src Add removeFunction/removeOperator 2023-04-10 15:40:20 +03:00
tests Add removeFunction/removeOperator 2023-04-10 15:40:20 +03:00
.gitattributes Add .gitattributes 2023-02-09 12:33:47 +02:00
.gitignore Ignore docs build results 2023-02-10 08:04:06 +02:00
.gitlab-ci.yml CI 2023-02-09 12:57:02 +02:00
CHANGELOG.md Document changes and add changelog for 1.1.0 2023-04-10 15:41:58 +03:00
LICENSE.md License 2023-02-09 12:52:23 +02:00
README.md Changelog for 0.4.0 2023-02-23 16:45:36 +02:00
TODO.md Detect missing operator 2023-03-13 15:59:52 +02:00
composer.json Stable code standard 2023-02-13 12:01:08 +02:00
phpcs.xml Update code style 2023-02-09 13:11:44 +02:00
phpunit.dist.xml Import the prototype 2023-02-09 12:31:31 +02:00
psalm.xml Make parser return a structure containing required vars and funcs for the call 2023-02-14 08:09:19 +02:00

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.