PHP Code Analysis

Open-source PHP projects categorized as Code Analysis

Top 23 PHP Code Analysis Projects

  • GitHub repo PHP Parser

    A PHP parser written in PHP

    Project mention: Tree-sitter: an incremental parsing system for programming tools | | 2021-02-22

    I wish there was a more universal format for parsers, but I just don't think there enough people who know their stuff.

    Take PHP, a language that a lot of people use: the tree-sitter-php extension doesn't support features added in 2019, let alone features added towards the end of 2020.

    If you want an up-to-date PHP parser, there's really only one open-source parser[0] that's accurate enough to be used on PHP codebases old and new, and it's written in PHP. Then if you want to parse in a robust fashion you have to adopt a number of hacks to get everything working.

    I hadn't encountered LSIF before – can GitHub be configured to use those maps?


  • GitHub repo PHP CS Fixer

    A tool to automatically fix PHP Coding Standards issues

    Project mention: Automating code quality check using GrumPHP in Magento 2 | | 2021-04-11

    PHPCS Fixer 2

  • GitHub repo PHPStan

    PHP Static Analysis Tool - discover bugs in your code without running it!

    Project mention: Automating code quality check using GrumPHP in Magento 2 | | 2021-04-11
  • GitHub repo PHP Code Sniffer

    PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

    Project mention: Automating code quality check using GrumPHP in Magento 2 | | 2021-04-11

    suppose we miss a space at the end of the file, and phpcs fails while running the automated pipelines on pull request merge.

  • GitHub repo phan

    Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.

    Project mention: What is a good tool to check codebase compatibility with PHP 8? | | 2021-04-12

    - Phan ( seems that it can check for backward compatibility but I've yet to find a way to configure it for forward-compatibility

  • GitHub repo Rector

    Instant Upgrades and Instant Refactoring of any PHP 5.3+ code

    Project mention: Today marks the first time my product does not support PHP versions that reached EOL | | 2021-04-12

    7.3 to 7.2:

  • GitHub repo GrumPHP

    A PHP code-quality tool

    Project mention: Automating code quality check using GrumPHP in Magento 2 | | 2021-04-11

    grumphp can be configured to listen to git commit commands and will not allow until all quality checks passed.

  • GitHub repo PHP Metrics

    Beautiful and understandable static analysis tool for PHP

  • GitHub repo PHPLOC

    A tool for quickly measuring the size of a PHP project.

  • GitHub repo PHPCPD

    Copy/Paste Detector (CPD) for PHP code.

  • GitHub repo PHP Mess Detector

    PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

    Project mention: Automating code quality check using GrumPHP in Magento 2 | | 2021-04-11
  • GitHub repo php-language-server

    PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥

    Project mention: How to use (and contribute) to neovim's built-in language server client and nvim-lspconfig | | 2021-01-07

    but as many people working in a lot of things I have no time to try to configure with nvim-lsp

  • GitHub repo Better Reflection

    :crystal_ball: Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.

  • GitHub repo PHPPHP

    A PHP VM implementation in PHP

  • GitHub repo Phpactor

    PHP completion, refactoring, introspection tool and language server.

    Project mention: Does anyone use vim to develop in PHP with Symfony? | | 2021-02-01

    Im using this with ncm2 with ale. Im quite happy with it.

  • GitHub repo UBench

    Micro PHP benchmark library

  • GitHub repo PhpDependencyAnalysis

    Static code analysis to find violations in a dependency graph

  • GitHub repo PHP Semantic Versioning Checker

    Compares two source sets and determines the appropriate semantic versioning to apply.

  • GitHub repo Mondrian

    A static php code analysis tool using the Graph Theory

  • GitHub repo Exakat

    The Exakat Engine : smart static analysis for PHP

  • GitHub repo Athletic

    PHP Benchmarking Framework

  • GitHub repo Dissect

    A set of tools for lexical and syntactical analysis written in pure PHP.

  • GitHub repo PHP Migration

    A static analyzer for PHP version migration

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2021-04-12.


What are some of the best open-source Code Analysis projects in PHP? This list will help you:

Project Stars
1 PHP Parser 14,357
2 PHP CS Fixer 10,017
3 PHPStan 9,732
4 PHP Code Sniffer 8,502
5 phan 5,038
6 Rector 3,993
7 GrumPHP 3,477
8 PHP Metrics 2,089
9 PHPLOC 2,089
10 PHPCPD 2,045
11 PHP Mess Detector 1,886
12 php-language-server 1,025
13 Better Reflection 890
14 PHPPHP 788
15 Phpactor 600
16 UBench 538
17 PhpDependencyAnalysis 507
18 PHP Semantic Versioning Checker 412
19 Mondrian 379
20 Exakat 348
21 Athletic 313
22 Dissect 215
23 PHP Migration 189