PHPackages                             prettus/php-fiql-parser - 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. prettus/php-fiql-parser

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

prettus/php-fiql-parser
=======================

FIQL Parser

366PHP

Since Oct 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/andersao/php-fiql-parser)[ Packagist](https://packagist.org/packages/prettus/php-fiql-parser)[ RSS](/packages/prettus-php-fiql-parser/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (4)Used By (0)

FIQL Parser
-----------

[](#fiql-parser)

[![Latest Stable Version](https://camo.githubusercontent.com/0849525dd0188ed20fe42e671d71fdccfb7551d450cdef78159cb5316bcc1412/687474703a2f2f706f7365722e707567782e6f72672f707265747475732f7068702d6669716c2d7061727365722f76)](https://packagist.org/packages/prettus/php-fiql-parser)[![Total Downloads](https://camo.githubusercontent.com/f9355c4d61264c1ac32060766a31a53854c9ed9e568715e0b8b2a3b1ac6f5da0/687474703a2f2f706f7365722e707567782e6f72672f707265747475732f7068702d6669716c2d7061727365722f646f776e6c6f616473)](https://packagist.org/packages/prettus/php-fiql-parser)[![License](https://camo.githubusercontent.com/df6e0fb6408f35a477839dcf35b2d20aad0755115c5b7a961472368e1db3f386/687474703a2f2f706f7365722e707567782e6f72672f707265747475732f7068702d6669716c2d7061727365722f6c6963656e7365)](https://packagist.org/packages/prettus/php-fiql-parser)[![PHP Version Require](https://camo.githubusercontent.com/72987cbccd732841cb4c57b920b86768ba904b6a1b1b7c9661d3382c6377a938/687474703a2f2f706f7365722e707567782e6f72672f707265747475732f7068702d6669716c2d7061727365722f726571756972652f706870)](https://packagist.org/packages/prettus/php-fiql-parser)[![Maintainability](https://camo.githubusercontent.com/9f83f37f353f2540c96e75058c98e33c3ca9ef60f5f2bf5912c02f97aeda1b9e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65343230343230356131653238396230336631382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/andersao/php-fiql-parser/maintainability)[![Test Coverage](https://camo.githubusercontent.com/dc96a1b01ffd70ed7d8539334ed787d7c91fef9140ea50d6fc929df06827c946/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65343230343230356131653238396230336631382f746573745f636f766572616765)](https://codeclimate.com/github/andersao/php-fiql-parser/test_coverage)

A PHP parser for the Feed Item Query Language ([FIQL](https://datatracker.ietf.org/doc/html/draft-nottingham-atompub-fiql-00)).

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

[](#installation)

```
composer require prettus/php-fiql-parser
```

Using Parser
------------

[](#using-parser)

```
use \Prettus\FIQLParser\Parser;
use \Prettus\FIQLParser\Expression;
use \Prettus\FIQLParser\Exceptions\FiqlException;

$expression = Parser::fromString('last_name==foo*,(age=lt=55;age=gt=5)');

print_r($expression->toArray());
print_r($expression->toJson());

/**
 * Output of toJson()
 *
 * {"or":[["last_name","==","foo*"],{"and":[["age","","5"]]}]}
 */

/**
 * Output of toArray()
 *
 * [
 *     'or' => [
 *         ['last_name', '==', 'foo*'],
 *         [
 *             'and' => [
 *                 ['age', '', 5],
 *             ]
 *         ]
 *     ]
 * ]
 * /
```

Using Builder
-------------

[](#using-builder)

```
use \Prettus\FIQLParser\Expression;
use \Prettus\FIQLParser\Constraint;
use \Prettus\FIQLParser\Operator;
use \Prettus\FIQLParser\Exceptions\FiqlException;

$expression = new Expression();
$expression->addElement(new Constraint('last_name', '==', 'foo*'));
$expression->addElement(new Operator(','));

$subExpression = new Expression();
$subExpression->addElement(new Constraint('age', '=lt=', '55'));
$subExpression->addElement(new Operator(';'));
$subExpression->addElement(new Constraint('age', '=gt=', '5'));

$expression->addElement($subExpression);

print_r(strval($expression));
// last_name==foo*,age=lt=55;age=gt=5
```

Credits
-------

[](#credits)

This project is completely inspired by python [fiql-parser](https://github.com/sergedomk/fiql_parser)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2243981?v=4)[andersonandrade](/maintainers/andersonandrade)[@andersonandrade](https://github.com/andersonandrade)

---

Top Contributors

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

---

Tags

fiqlfiql-parserphp

### Embed Badge

![Health badge](/badges/prettus-php-fiql-parser/health.svg)

```
[![Health](https://phpackages.com/badges/prettus-php-fiql-parser/health.svg)](https://phpackages.com/packages/prettus-php-fiql-parser)
```

###  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)
