Skip to content
CAI
Produce a survey ↗Verify a survey

nikic/PHP-Parser

This system is a PHP parser and code analysis library that converts PHP source code into an Abstract Syntax Tree (AST). It provides tools for parsing, building, and pretty-printing PHP code across multiple versions, supporting modern language features like enums, attributes, and type declarations. The library includes a builder API for AST construction, visitors for tree traversal, and utilities for format preservation and static analysis.

61.0

Adequate · 2 August 2026

22k

lines of production code

PHP

primary language

1

bus factor · 164 authors in all

3

measurements over time

CAI band scale
CAI trend line

How it got here

2011–2012 · Parser modernization and test coverage

The project replaced its legacy PHP parser infrastructure with a new grammar-based system, removing obsolete classes and build tools. This refactor was accompanied by extensive test coverage for the new parser, covering expressions, statements, and the pretty printer across multiple PHP versions.

16 changes

2014 · AST node modernization and builder API

The project underwent a comprehensive refactoring of its abstract syntax tree, replacing array-based structures with strongly typed, PHP 7+ compatible node classes. This period introduced a fluent builder API for AST construction, expanded support for modern PHP features like enums and attributes, and added new node visitors for traversal and analysis.

20 changes

2015–2023 · PHP 7-8 parser and formatting support

This period focused on extending the library to support PHP 7 and PHP 8 syntax, including new language features like match expressions, enums, and attributes. Significant effort was also dedicated to implementing format-preserving pretty-printing and adding comprehensive test coverage for the new parsers and formatting utilities.

15 changes

CAI lens gauges

Survey your own repository

nikic/PHP-Parser was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point the surveyor at a repository you know and see whether you agree with it.

Survey a repository

About this page

  • The description of this project is derived from its own commit history, not from its README.
  • The score is its highest published measurement, taken on 2 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit fbd47f7ebc — the exact code this score is about.
  • Scored under rubric rubric-2026.08.18. Score the same commit under that rubric and you get the same number.
CAI link cards