PHPackages                             benyitzhaki/phpep - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. benyitzhaki/phpep

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

benyitzhaki/phpep
=================

PHP Expression Parser - ported from soney/jsep http://jsep.from.so

113.0k1JavaScript

Since Mar 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/benyitzhaki/phpep)[ Packagist](https://packagist.org/packages/benyitzhaki/phpep)[ RSS](/packages/benyitzhaki-phpep/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

phpep: A Tiny PHP Expression Parser - Ported from jsep
------------------------------------------------------

[](#phpep-a-tiny-php-expression-parser---ported-from-jsep)

[phpep](http://jsep.from.so/) is a simple expression parser written in PHP, ported from JavaScript. It can parse expressions but not operations. The difference between expressions and operations is akin to the difference between a cell in an Excel spreadsheet vs. a proper JavaScript program.

### Why phpep?

[](#why-phpep)

I wanted a lightweight, tiny parser to be included in one of my other libraries. jsep provided this functionality. I also wanted to be able to parse these expressions in my PHP projects, which led me to porting jsep.

### Usage

[](#usage)

#### PHP

[](#php)

```
require('phpep.php');
$expr = new PHPEP("1 + 1");
$stack = $expr->exec();
var_dump($stack);

```

#### Custom Operators

[](#custom-operators)

```
// Not yet implemented.

```

### Install dependencies

[](#install-dependencies)

Dependencies are managed using composer. To install the dependencies, run the following command: `php composer.phar install`

### PHPUnit Tests

[](#phpunit-tests)

This library is using php unit testing framework. In order to test the library, run the following command: `/vendor/bin/phpunit`

### License

[](#license)

phpep is under the MIT license. See LICENSE file.

### Thanks

[](#thanks)

Thanks to Stephen Oney for the original jsep project Some parts of the latest version of jsep were adapted from the esprima parser.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b91d34a518fa23b0f6208335d2110c512ff18710592eb63dccb34c2459e4a7e8?d=identicon)[benyitzhaki](/maintainers/benyitzhaki)

---

Top Contributors

[![soney](https://avatars.githubusercontent.com/u/211262?v=4)](https://github.com/soney "soney (77 commits)")[![benyitzhaki](https://avatars.githubusercontent.com/u/2536651?v=4)](https://github.com/benyitzhaki "benyitzhaki (9 commits)")[![ZeunO8](https://avatars.githubusercontent.com/u/95558717?v=4)](https://github.com/ZeunO8 "ZeunO8 (4 commits)")[![nikiml](https://avatars.githubusercontent.com/u/381523?v=4)](https://github.com/nikiml "nikiml (2 commits)")[![duncanbeevers](https://avatars.githubusercontent.com/u/7367?v=4)](https://github.com/duncanbeevers "duncanbeevers (2 commits)")[![sandbox](https://avatars.githubusercontent.com/u/82713?v=4)](https://github.com/sandbox "sandbox (1 commits)")[![EricSmekens](https://avatars.githubusercontent.com/u/2444820?v=4)](https://github.com/EricSmekens "EricSmekens (1 commits)")

### Embed Badge

![Health badge](/badges/benyitzhaki-phpep/health.svg)

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[karriere/json-decoder

JsonDecoder implementation that allows you to convert your JSON data into PHP class objects

140439.4k12](/packages/karriere-json-decoder)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46143.1k6](/packages/jstewmc-rtf)[json-mapper/laravel-package

The JsonMapper package for Laravel

25188.9k3](/packages/json-mapper-laravel-package)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)

PHPackages © 2026

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