PHPackages                             zhuravljov/calc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zhuravljov/calc

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zhuravljov/calc
===============

Library for the calculation of simple math expressions

1.0.1(11y ago)3931BSD-3-ClausePHPPHP &gt;=5.4.0

Since Apr 18Pushed 11y ago1 watchersCompare

[ Source](https://github.com/zhuravljov/calc)[ Packagist](https://packagist.org/packages/zhuravljov/calc)[ Docs](https://github.com/zhuravljov/calc)[ RSS](/packages/zhuravljov-calc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (1)

Calculator
==========

[](#calculator)

Library for the calculation of simple math expressions without using `eval()`.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ composer require zhuravljov/calc

```

or add

```
"zhuravljov/calc": "*"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

```
$calculator = new \zhuravljov\calc\Calculator();
$calculator->calc('2 + 2 * 2'); // 6
$calculator->calc('(2 + 2) * 2'); // 8
$calculator->calc('(2 + 2'); // CalcException
```

Available operations `+`, `-`, `*` and `/`.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Total

2

Last Release

4029d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1656851?v=4)[Roman Zhuravlev](/maintainers/Zhuravljov)[@zhuravljov](https://github.com/zhuravljov)

---

Top Contributors

[![zhuravljov](https://avatars.githubusercontent.com/u/1656851?v=4)](https://github.com/zhuravljov "zhuravljov (4 commits)")

---

Tags

calculationsexpressionmathphpmathcalculator

### Embed Badge

![Health badge](/badges/zhuravljov-calc/health.svg)

```
[![Health](https://phpackages.com/badges/zhuravljov-calc/health.svg)](https://phpackages.com/packages/zhuravljov-calc)
```

###  Alternatives

[brick/math

Arbitrary-precision arithmetic library

2.1k504.0M277](/packages/brick-math)[markrogoyski/math-php

Math Library for PHP. Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra

2.4k7.1M40](/packages/markrogoyski-math-php)[phpseclib/bcmath_compat

PHP 5.x-8.x polyfill for bcmath extension

16720.7M17](/packages/phpseclib-bcmath-compat)[rubix/tensor

A library and extension that provides objects for scientific computing in PHP.

2751.4M5](/packages/rubix-tensor)[markrogoyski/ipv4-subnet-calculator

Network calculator for subnet mask and other classless (CIDR) network information.

177813.7k6](/packages/markrogoyski-ipv4-subnet-calculator)[jlawrence/eos

Parse and solve math equations without using 'eval()'.

1071.1M11](/packages/jlawrence-eos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
