PHPackages                             layered/safe-eval - 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. layered/safe-eval

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

layered/safe-eval
=================

Safely evaluate code expressions

v0.2(7y ago)24911MITPHP

Since Apr 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/AndreiIgna/safe-eval)[ Packagist](https://packagist.org/packages/layered/safe-eval)[ RSS](/packages/layered-safe-eval/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Safe Eval
=========

[](#safe-eval)

Safely evaluate code expressions in PHP, without using `eval`. [ExpressionLanguage](https://github.com/symfony/expression-language) is most likely better at this, but SafeEval still supports PHP 5, for the projects that need it.

Usage
-----

[](#usage)

```
use Layered\SafeEval\SafeEval;

$safeEval = new SafeEval;

echo $safeEval->eval('1 + 2');
var_dump($safeEval->eval('1 or 0'));
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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 ~5 days

Total

2

Last Release

2619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/04be6a13bd2e1d72af13c56198468f669f39660d5c2cc8a54f8af3767d2b88bd?d=identicon)[AndreiHere](/maintainers/AndreiHere)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/layered-safe-eval/health.svg)

```
[![Health](https://phpackages.com/badges/layered-safe-eval/health.svg)](https://phpackages.com/packages/layered-safe-eval)
```

PHPackages © 2026

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