arokettu/arithmetic-parser

可配置的算术解析器和解释器

3.0.0 2024-09-20 22:50 UTC

This package is auto-updated.

Last update: 2024-09-20 23:39:01 UTC


README

Packagist PHP Packagist Gitlab pipeline status Codecov

这是一个可以解析和解释算术表达式的库。它的目标是可配置,并且可以安全地处理最终用户的输入。

安装

composer require 'arokettu/arithmetic-parser'

示例

<?php

\Arokettu\ArithmeticParser\Calculator::evaluate('x + y', x: 2, y: 3); // 5

文档

在此处阅读完整文档:https://sandfox.dev/php/arithmetic-parser.html

也在Read the Docs上:https://php-arithmetic-parser.readthedocs.io

支持

请在GitLab的我们的主要仓库中提交问题:https://gitlab.com/sandfox/arithmetic-parser/-/issues

在我们的Gitter房间中随时提问:https://gitter.im/arokettu/community

许可证

该库根据MIT许可证作为开源软件提供。