PHPackages                             nemorize/fexpr - 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. nemorize/fexpr

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

nemorize/fexpr
==============

Simple filter query language parser (originally written in go by ganigeorgiev/fexpr)

0.0.2(2y ago)011BSD-3-ClausePHPPHP &gt;=8.1

Since Jul 14Pushed 2y agoCompare

[ Source](https://github.com/nemorize/php-fexpr)[ Packagist](https://packagist.org/packages/nemorize/fexpr)[ RSS](/packages/nemorize-fexpr/feed)WikiDiscussions main Synced 1mo ago

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

php-fexpr
=========

[](#php-fexpr)

**php-fexpr** is a PHP-ported version of [ganigeorgiev/fexpr](https://github.com/ganigeorgiev/fexpr)that allows you to parse a filter query language and provides easy to work with AST structures.

Supports parenthesis and various conditional expression operators (see original project's [Grammar](https://github.com/ganigeorgiev/fexpr#grammar))

Example usage
-------------

[](#example-usage)

```
composer require nemorize/fexpr
```

```
$ast = (new \Nemorize\Fexpr\Parser())->parse('id = 123 && status = "active"');
// json_encode($ast): [
//     {
//         "operation": {
//             "type": "join",
//             "literal": "&&"
//         },
//         "item": {
//             "left": {
//                 "type": "identifier",
//                 "literal": "id"
//             },
//             "operation": {
//                 "type": "sign",
//                 "literal": "=",
//             },
//             "right": {
//                 "type": "number",
//                 "literal": "123"
//             }
//         }
//     },
//     {
//         "operation": {
//             "type": "join",
//             "literal": "&&"
//         },
//         "item": {
//             "left": {
//                 "type": "identifier",
//                 "literal": "status"
//             },
//             "operation": {
//                 "type": "sign",
//                 "literal": "=",
//             },
//             "right": {
//                 "type": "string",
//                 "literal": "active"
//             }
//         }
//     }
// ]
```

Using only the scanner
----------------------

[](#using-only-the-scanner)

The tokenizer (aka. `\Nemorize\Fexpr\Scanner`) could be used without the parser\\s state machine so that you can write your own custom tokens processing:

```
$scanner = new \Nemorize\Fexpr\Scanner();
foreach ($scanner->scan('id > 123') as $token) {
    var_dump($token);
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Total

2

Last Release

1035d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12807795da10cb0139c1cc631cb308d9ed8a4a0d48348c733266bfdddb580ed5?d=identicon)[nemorize](/maintainers/nemorize)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nemorize-fexpr/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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