PHPackages                             vektah/parser-combinator - 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. vektah/parser-combinator

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

vektah/parser-combinator
========================

0.2.4(12y ago)137.8k↓100%1[4 issues](https://github.com/Vektah/parser-combinator/issues)BSD-2-ClausePHPPHP &gt;=5.4.0

Since Sep 12Pushed 12y agoCompare

[ Source](https://github.com/Vektah/parser-combinator)[ Packagist](https://packagist.org/packages/vektah/parser-combinator)[ Docs](https://github.com/Vektah/parser-combinator)[ RSS](/packages/vektah-parser-combinator/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (8)Used By (0)

parser-combinator [![Build Status](https://camo.githubusercontent.com/44365ec5694642cf472e4de45eff58738757255cb5150dd011327788ada73c1e/68747470733a2f2f7472617669732d63692e6f72672f56656b7461682f7061727365722d636f6d62696e61746f722e706e67)](https://travis-ci.org/Vektah/parser-combinator)
=============================================================================================================================================================================================================================================================================================

[](#parser-combinator-)

A simple parser combinator framework written in PHP.

Google protobuffer parser:
--------------------------

[](#google-protobuffer-parser)

```
$parser = new ProtoParser();
$out = $parser->parse('
    message Bar {
        required MessageType type = 0;
        required bytes data = 1;

        enum Foo {
            asdf = 0;
            qwer = 1;
        }
    }
');

// $out will contain return a parse tree that looks like this:
[
    new Message('Bar', [
        new Field('required', 'MessageType', 'type', 0),
        new Field('required', 'bytes', 'data', 1),
        new Enum('Foo', [
            new EnumValue('asdf', 0),
            new EnumValue('qwer', 1)
        ])
    ])
];

```

Json parser:
------------

[](#json-parser)

The only reason you would use this parser is for error messages. It is much slower then the C library used by php to parse json. It could be used to automatically reparse json in failure cases and display helpful error messages.

```
$parser = new JsonParser();
$out = $parser->parse('{"asdf": { "foo" : "bar" }}');

// $out will contain a parse tree that looks like this:
[
  'asdf' => [
    'foo' => 'bar'
  ]
]

```

###  Health Score

24

—

LowBetter than 35% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Recently: every ~7 days

Total

7

Last Release

4422d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05cbc29645134e6b4b1472e66a3966f5627d346ddbfacf6c873e48b2e15c64af?d=identicon)[Vektah](/maintainers/Vektah)

---

Top Contributors

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

---

Tags

parserlexerparser combinatorcombinator

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/vektah-parser-combinator/health.svg)

```
[![Health](https://phpackages.com/badges/vektah-parser-combinator/health.svg)](https://phpackages.com/packages/vektah-parser-combinator)
```

###  Alternatives

[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k896.2M98](/packages/doctrine-lexer)[cerbero/json-parser

Zero-dependencies pull parser to read large JSON from any source in a memory-efficient way.

804445.9k5](/packages/cerbero-json-parser)[parsica-php/parsica

The easiest way to build robust parsers in PHP.

412130.3k4](/packages/parsica-php-parsica)[creof/geo-parser

Parser for geography coordinate strings

634.3M15](/packages/creof-geo-parser)[creof/wkt-parser

Parser for well-known text (WKT) object strings

554.8M16](/packages/creof-wkt-parser)[tmilos/lexer

Lexical analyzer with individual token definition with regular expressions

211.7M2](/packages/tmilos-lexer)

PHPackages © 2026

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