PHPackages                             doctrine/lexer - 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. doctrine/lexer

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

doctrine/lexer
==============

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

3.0.1(2y ago)11.2k910.8M—5.2%62[2 issues](https://github.com/doctrine/lexer/issues)20MITPHPPHP ^8.1CI passing

Since Jan 12Pushed 1mo ago19 watchersCompare

[ Source](https://github.com/doctrine/lexer)[ Packagist](https://packagist.org/packages/doctrine/lexer)[ Docs](https://www.doctrine-project.org/projects/lexer.html)[ Fund](https://www.doctrine-project.org/sponsorship.html)[ Patreon](https://www.patreon.com/phpdoctrine)[ RSS](/packages/doctrine-lexer/feed)WikiDiscussions 3.0.x Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (23)Used By (20)

Doctrine Lexer
==============

[](#doctrine-lexer)

[![Build Status](https://github.com/doctrine/lexer/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/lexer/actions)

Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.

This lexer is used in Doctrine Annotations and in Doctrine ORM (DQL).

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance60

Regular maintenance activity

Popularity86

Widely adopted with strong download metrics

Community47

Growing community involvement

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 52% 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 ~229 days

Recently: every ~194 days

Total

22

Last Release

56d ago

Major Versions

1.2.3 → 2.0.02022-12-11

1.3.x-dev → 2.0.x-dev2022-12-11

2.1.0 → 3.0.02022-12-15

2.1.1 → 3.0.12024-02-05

3.1.x-dev → 4.0.x-dev2026-01-24

PHP version history (6 changes)v1.0PHP &gt;=5.3.2

1.1.x-devPHP ^7.2

1.2.1PHP ^7.2 || ^8.0

1.2.2PHP ^7.1 || ^8.0

3.0.0PHP ^8.1

4.0.x-devPHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/892698bb1d3f6dae0e3a44abe3e26920ddb4eb000c6c583c87b4db5e5027e166?d=identicon)[beberlei](/maintainers/beberlei)

---

Top Contributors

[![greg0ire](https://avatars.githubusercontent.com/u/657779?v=4)](https://github.com/greg0ire "greg0ire (131 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (27 commits)")[![derrabus](https://avatars.githubusercontent.com/u/1506493?v=4)](https://github.com/derrabus "derrabus (17 commits)")[![alcaeus](https://avatars.githubusercontent.com/u/383198?v=4)](https://github.com/alcaeus "alcaeus (17 commits)")[![SenseException](https://avatars.githubusercontent.com/u/859964?v=4)](https://github.com/SenseException "SenseException (13 commits)")[![jwage](https://avatars.githubusercontent.com/u/97422?v=4)](https://github.com/jwage "jwage (10 commits)")[![guilhermeblanco](https://avatars.githubusercontent.com/u/208883?v=4)](https://github.com/guilhermeblanco "guilhermeblanco (4 commits)")[![beberlei](https://avatars.githubusercontent.com/u/26936?v=4)](https://github.com/beberlei "beberlei (4 commits)")[![instabledesign](https://avatars.githubusercontent.com/u/1098878?v=4)](https://github.com/instabledesign "instabledesign (4 commits)")[![Defender32](https://avatars.githubusercontent.com/u/19220616?v=4)](https://github.com/Defender32 "Defender32 (3 commits)")[![adaamz](https://avatars.githubusercontent.com/u/4347332?v=4)](https://github.com/adaamz "adaamz (2 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (2 commits)")[![Majkl578](https://avatars.githubusercontent.com/u/144181?v=4)](https://github.com/Majkl578 "Majkl578 (2 commits)")[![malarzm](https://avatars.githubusercontent.com/u/4947711?v=4)](https://github.com/malarzm "malarzm (2 commits)")[![siwinski](https://avatars.githubusercontent.com/u/1034024?v=4)](https://github.com/siwinski "siwinski (1 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")[![mikeSimonson](https://avatars.githubusercontent.com/u/907613?v=4)](https://github.com/mikeSimonson "mikeSimonson (1 commits)")[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (1 commits)")[![norberttech](https://avatars.githubusercontent.com/u/1921950?v=4)](https://github.com/norberttech "norberttech (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")

---

Tags

phpparserannotationsdocblocklexer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/doctrine-lexer/health.svg)

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

###  Alternatives

[jan-swiecki/simple-annotations

Simple annotation parser

66615.0k18](/packages/jan-swiecki-simple-annotations)

PHPackages © 2026

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