PHPackages                             patchwork/php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. patchwork/php-parser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

patchwork/php-parser
====================

Fast and extensible PHP code analysis and transformation

6271PHP

Since Nov 12Pushed 11y ago1 watchersCompare

[ Source](https://github.com/nicolas-grekas/Patchwork-PHP-Parser)[ Packagist](https://packagist.org/packages/patchwork/php-parser)[ RSS](/packages/patchwork-php-parser/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Patchwork PHP Parser
====================

[](#patchwork-php-parser)

Patchwork PHP Parser is aimed at building fast, memory efficient and highly modular PHP code transformations and analysis. It is written for PHP 5.3 around the tokenizer extension.

It can be used for example to:

- compute static code analysis,
- verify coding practices for QA,
- backport some language features,
- extend the PHP language,
- build a code preprocessor,
- build an aspect weaver,
- etc.

As an illustrative example, it can backport namespaces and closures and should easily be able to compile itself to PHP 5.2.

Although it is written for PHP 5.3, it can parse PHP 5.4 code and already has backports for the short array syntax, the binary number notation and enabling the short open echo tag regardless of the short\_open\_tag ini setting.

Licensing
---------

[](#licensing)

Patchwork PHP Parser is free software; you can redistribute it and/or modify it under the terms of the (at your option):

- [Apache License v2.0](http://apache.org/licenses/LICENSE-2.0.txt), or
- [GNU General Public License v2.0](http://gnu.org/licenses/gpl-2.0.txt).

This code is extracted from the [Patchwork](http://pa.tchwork.com/) framework, where it has been proven stable and flexible enough to implement many kind of code transformations.

It is released here standalone in the hope that it can be used in a different context successfully!

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/243674?v=4)[Nicolas Grekas](/maintainers/nicolas-grekas)[@nicolas-grekas](https://github.com/nicolas-grekas)

---

Top Contributors

[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (625 commits)")

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

29961.3k10](/packages/kartik-v-yii2-money)[jclg/php-slack-bot

Slack bot user written in PHP

16725.6k1](/packages/jclg-php-slack-bot)[themeselection/master-laravel-bootstrap-jetstream

A Laravel 11 package to easily switch TailwindCSS resources generated by Laravel Jetstream to Bootstrap 5.

122.0k](/packages/themeselection-master-laravel-bootstrap-jetstream)[shieldfy/sniffer

sniff input types

101.5k1](/packages/shieldfy-sniffer)

PHPackages © 2026

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