PHPackages                             scato/phpeg - 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. scato/phpeg

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

scato/phpeg
===========

PEG Parser Generator

1.0.2(11y ago)985211MITPHPPHP &gt;=5.3.0CI failing

Since Jul 20Pushed 5y ago2 watchersCompare

[ Source](https://github.com/scato/phpeg)[ Packagist](https://packagist.org/packages/scato/phpeg)[ RSS](/packages/scato-phpeg/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (4)Versions (9)Used By (1)

PHPeg
=====

[](#phpeg)

PEG Parser Generator

This project is still unstable. Some features like case-insensitive literals are stil missing. The rest should work, though.

Usage
-----

[](#usage)

Install this tool as a dev requirement:

```
"require-dev": {
    "scato/phpeg": "1.*"
}

```

You can now generate (and regenerate) parsers using the command line tool:

```
$ vendor/bin/phpeg generate  []

```

Read [the grammar section](doc/grammar.md) in the documentation for help on the grammar syntax. Read [the usage section](doc/usage.md) for more details on both basic and advanced usage.

About
-----

[](#about)

PHPeg is a PEG parser generator.

The generated parser is a PEG parser that uses memoization. This effectively makes it a Packrat Parser, or so I'm told.

PHPeg is heavily inspired by [PEG.js](http://pegjs.majda.cz/). [The grammar section](doc/grammar.md) contains details on the differences.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 99.4% 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 ~36 days

Recently: every ~55 days

Total

8

Last Release

4068d ago

Major Versions

0.3.2 → 1.0.02014-08-25

### Community

Maintainers

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

---

Top Contributors

[![scato](https://avatars.githubusercontent.com/u/207346?v=4)](https://github.com/scato "scato (178 commits)")[![hanneskod](https://avatars.githubusercontent.com/u/1369274?v=4)](https://github.com/hanneskod "hanneskod (1 commits)")

---

Tags

parserpeg

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/scato-phpeg/health.svg)

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

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k902.6M1.8k](/packages/nikic-php-parser)[doctrine/lexer

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

11.2k910.8M118](/packages/doctrine-lexer)[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

2.9k404.0M702](/packages/league-commonmark)[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)

PHPackages © 2026

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