Analysis tools logo

109 PHP Static Analysis Tools

Type:
Any

What is PHP?

PHP is a general-purpose scripting language especially suited to web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994; (...). PHP originally stood for Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor. (...) PHP code is usually processed on a web server by a PHP interpreter implemented as a module, a daemon or as a Common Gateway Interface (CGI) executable.

(More info)

What are the best PHP analysis tools?

113

Mega-Linter

  • Type: cli
959

Mega-Linter can handle any type of project thanks to its 70+ embedded Linters, its advanced reporting, runnable on any CI system or locally, with assisted installation and configuration, able to apply formatting and fixes

69

Semgrep

  • Type: cli
  • Type: service
7455

A fast, open-source, static analysis tool for finding bugs and enforcing code standards at editor, commit, and CI time. Its rules look like the code you already write; no abstract syntax trees or regex wrestling. Supports 17+ languages.

51

PHPStan

  • Type: cli
11496

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

49
48

Sonatype

  • Type: service

Reports known vulnerabilities in common dependencies and recommends updated packages to minimize breaking changes

42

Psalm

  • Type: cli
5002

Static analysis tool for finding type errors in PHP applications.

25

ThreatMapper

  • Type: service
  • Type: web
2581

Vulnerability Scanner and Risk Evaluation for containers, serverless and hosts at runtime. ThreatMapper generates runtime BOMs from dependencies and operating system packages, matches against multiple threat feeds, scans for unprotected secrets, and scores issues based on severity and risk-of-exploit.

24

CodeScene

  • Type: service

CodeScene is a quality visualization tool for software. Prioritize technical debt, detect delivery risks, and measure organizational aspects. Fully automated.

19

PHP Coding Standards Fixer

  • Type: cli
11554

Fixes your code according to standards like PSR-1, PSR-2, and the Symfony standard.

18

Coverity

  • Type: cli

Synopsys Coverity supports 20 languages and over 70 frameworks including Ruby on rails, Scala, PHP, Python, JavaScript, TypeScript, Java, Fortran, C, C++, C#, VB.NET.

18

phan

  • Type: cli
5342

A modern static analyzer from etsy.

14

Better Code Hub

  • Type: service

Better Code Hub checks your GitHub codebase against 10 engineering guidelines devised by the authority in software quality, Software Improvement Group.

14

Php Inspections (EA Extended)

  • Type: cli
1351

A Static Code Analyzer for PHP.

13

PHP_CodeSniffer

  • Type: cli
9857

Detects violations of a defined set of coding standards.

7

deptrac

  • Type: cli
2142

Enforce rules for dependencies between software layers.

6

Codeac

  • Type: service

Automated code review tool integrates with GitHub, Bitbucket and GitLab (even self-hosted). Available for JavaScript, TypeScript, Python, Ruby, Go, PHP, Java, Docker, and more. (open-source free)

6

EasyCodingStandard

  • Type: cli
1036

Combine [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) and [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer).

6

PHPMD

  • Type: cli
2127

Finds possible bugs in your code.

5

Scanmycode CE (Community Edition)

  • Type: service
338

Scanmycode - Code Scanning/SAST/Linting using many tools/Scanners with One Report

4

Application Inspector

  • Type: service

Commercial Static Code Analysis which generates exploits to verify vulnerabilities.

4

Axivion Bauhaus Suite

  • Type: cli

Tracks down error-prone code locations, style violations, cloned or dead code, cyclic dependencies and more for C/C++, C#/.NET, Java and Ada 83/Ada 95.

4

Unibeautify

  • Type: cli
  • Type: service
528

Universal code beautifier with a GitHub app. Supports HTML, CSS, JavaScript, TypeScript, JSX, Vue, C++, Go, Objective-C, Java, Python, PHP, GraphQL, Markdown, and more.

3

Fortify

  • Type: ide-plugin

A commercial static analysis platform that supports the scanning of C/C++, C#, VB.NET, VB6, ABAP/BSP, ActionScript, Apex, ASP.NET, Classic ASP, VB Script, Cobol, ColdFusion, HTML, Java, JS, JSP, MXML/Flex, Objective-C, PHP, PL/SQL, T-SQL, Python (2.6, 2.7), Ruby (1.9.3), Swift, Scala, VB, and XML.

3

pdepend

  • Type: cli
836

Calculates software metrics like cyclomatic complexity for PHP code.

3

PHP Architecture Tester

  • Type: cli
760

Easy to use architecture testing tool for PHP.

3

PHP Insights

  • Type: cli
4802

Instant PHP quality checks from your console. Analysis of code quality and coding style as well as overview of code architecture and its complexity.

3

phpcpd

  • Type: cli
2207

Copy/Paste Detector for PHP code.

2

GrumPHP

  • Type: cli
3858

Checks code on every commit.

2

Kiuwan

  • Type: service

Identify and remediate cyber threats in a blazingly fast, collaborative environment, with seamless integration in your SDLC. Python, C\C++, Java, C#, PHP and more.

2

PHP-Parser

  • Type: cli
15811

A PHP parser written in PHP.

2

phpca

  • Type: cli
92

Finds usage of non-built-in extensions.

2

phpdoc-to-typehint

  • Type: cli
228

Add scalar type hints and return types to existing PHP projects using PHPDoc annotations.

2

phpDocumentor

  • Type: cli
3713

Analyzes PHP source code to generate documentation.

2

PhpMetrics

  • Type: cli
2296

Calculates and visualizes various code quality metrics.

2

todocheck

  • Type: cli
395

Linter for integrating annotated TODOs with your issue trackers

2

trivy

  • Type: cli
15122

A Simple and Comprehensive Vulnerability Scanner for Containers and other Artifacts, Suitable for CI. Trivy detects vulnerabilities of OS packages (Alpine, RHEL, CentOS, etc.) and application dependencies (Bundler, Composer, npm, yarn, etc.). Checks containers and filesystems.

2

Codiga

  • Type: service

Automated Code Reviews and Technical Debt management platform that supports 12+ languages.

1

AppChecker

  • Type: cli

Static analysis for C/C++/C#, PHP and Java.

1

ApplicationInspector

  • Type: cli
4012

Creates reports of over 400 rule patterns for feature detection (e.g. the use of cryptography or version control in apps).

1

Atom-Beautify

  • Type: ide-plugin
1503

Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom editor.

1

churn-php

  • Type: cli
1284

Helps discover good candidates for refactoring.

1

CodeFlow

  • Type: service

Automated code analysis tool to deal with technical depth. Integrates with Bitbucket and Gitlab. (free for Open Source Projects)

1

dephpend

  • Type: cli
505

Dependency analysis tool.

1

deprecation-detector

  • Type: cli
389

Finds usages of deprecated (Symfony) code.

1

DesignPatternDetector

  • Type: cli
105

Detection of design patterns in PHP code.

1

Enlightn

  • Type: cli
713

A static and dynamic analysis tool for Laravel applications that provides recommendations to improve the performance, security and code reliability of Laravel apps. Contains 120 automated checks.

1

exakat

  • Type: service
369

An automated code reviewing engine for PHP.

1

larastan

  • Type: cli
4336

Adds static analysis to Laravel improving developer productivity and code quality. It is a wrapper around PHPStan.

1

lizard

  • Type: cli
1478

Lizard is an extensible Cyclomatic Complexity Analyzer for many programming languages including C/C++ (doesn't require all the header files or Java imports). It also does copy-paste detection (code clone detection/code duplicate detection) and many other forms of static code analysis. Counts lines of code without comments, CCN (cyclomatic complexity number), token count of functions, parameter count of functions.

1

Mondrian

  • Type: cli
391

A set of static analysis and refactoring tools which use graph theory.

1

parallel-lint

  • Type: cli
198

This tool checks syntax of PHP files faster than serial check with a fancier output.

1

Parse

  • Type: cli
340

A Static Security Scanner.

1

PHP Assumptions

  • Type: cli
152

Checks for weak assumptions.

1
1

PHP Semantic Versioning Checker

  • Type: cli
419

Suggests a next version according to semantic versioning.

1

php-speller

  • Type: cli
66

PHP spell check library.

1

PHP-Token-Reflection

  • Type: cli
190

Library emulating the PHP internal reflection.

1

PhpDependencyAnalysis

  • Type: cli
545

Builds a dependency graph for a project.

1

phploc

  • Type: cli
2262

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

1

phpmnd

  • Type: cli
513

Helps to detect magic numbers.

1

phpqa - jakzal

  • Type: cli
1085

Many tools for PHP static analysis in one container.

1

phpqa - jmolivas

  • Type: cli
333

PHPQA all-in-one Analyzer CLI tool.

1

PHPQA

  • Type: cli
541

A tool for running QA tools (phploc, phpcpd, phpcs, pdepend, phpmd, phpmetrics).

1

phpsa

  • Type: cli
647

Static analysis tool for PHP.

1

pre-commit

  • Type: cli
9291

A framework for managing and maintaining multi-language pre-commit hooks.

1

Progpilot

  • Type: cli
271

A static analysis tool for security purposes.

1

Qafoo Quality Analyzer

  • Type: cli
495

Visualizes metrics and source code.

1

Snyk Code

  • Type: service

Snyk Code finds security vulnerabilities based on AI. Its speed of analysis allow us to analyse your code in real time and deliver results when you hit the save button in your IDE. Supported languages are Java, JavaScript, Python, PHP, C#, Go and TypeScript. Integrations with GitHub, BitBucket and Gitlab. It is free to try and part of the Snyk platform also covering SCA, containers and IaC.

1

Tuli

  • Type: cli
171

A static analysis engine.

1

twig-lint

  • Type: cli
117

twig-lint is a lint tool for your twig files.

1

Undebt

  • Type: cli
1637

Language-independent tool for massive, automatic, programmable refactoring based on simple pattern definitions.

1

Upsource

  • Type: service

Code review tool with static code analysis and code-aware navigation for Java, PHP, JavaScript and Kotlin.

1

WhiteHat Application Security Platform

  • Type: cli

WhiteHat Scout (for Developers) combined with WhiteHat Sentinel Source (for Operations) supporting WhiteHat Top 40 and OWASP Top 10.

0

CAST Highlight

  • Type: cli

Commercial Static Code Analysis which runs locally, but uploads the results to its cloud for presentation.

0

codeburner

  • Type: cli
82

Provides a unified interface to sort and act on the issues it finds.

0

CodePatrol

  • Type: service

Automated SAST code reviews driven by security, supports 15+ languages and includes security training.

0

Depends

  • Type: cli
140

Analyses the comprehensive dependencies of code elements for Java, C/C++, Ruby.

0

Goodcheck

  • Type: cli
142

Regexp based customizable linter.

0

graudit

  • Type: cli
1168

Grep rough audit - source code auditing tool.

0

Nitpick CI

  • Type: service

Automated PHP code review.

0

Offensive 360

  • Type: web

Commercial Static Code Analysis system doesn't require building the source code or pre-compilation.

0

PhpDeprecationDetector

  • Type: cli
311

Analyzer of PHP code to search issues with deprecated functionality in newer interpreter versions. It finds removed objects (functions, variables, constants and ini-directives), deprecated functions functionality, and usage of forbidden names or tricks (e.g. reserved identifiers in newer versions).

0

Pronto

  • Type: cli
2528

Quick automated code review of your changes. Supports more than 40 runners for various languages, including Clang, Elixir, JavaScript, PHP, Ruby and more.

0

RIPS

  • Type: cli

A static source code analyser for vulnerabilities in PHP scripts.

0

Scrutinizer

  • Type: service

A proprietary code quality checker that can be integrated with GitHub.

0

Security Code Scan

  • Type: ide-plugin
805

Security code analyzer for C# and VB.NET. Detects various security vulnerability patterns: SQLi, XSS, CSRF, XXE, Open Redirect, etc. Integrates into Visual Studio 2015 and newer. Detects various security vulnerability patterns: SQLi, XSS, CSRF, XXE, Open Redirect, etc.

0

Sigrid

  • Type: cli
  • Type: service

Sigrid helps you to improve your software by measuring your system's code quality, and then compares the results against a benchmark of thousands of industry systems to give you concrete advice on areas where you can improve.

0

Soto Platform

  • Type: cli

Suite of static analysis tools consisting of the three components Sotoarc (Architecture Analysis), Sotograph (Quality Analysis), and Sotoreport (Quality report). Helps find differences between architecture and implementation, interface violations (e.g. external access of private parts of subsystems, detection of all classes, files, packages and subsystems which are strongly coupled by cyclical relationships and more. The Sotograph product family runs on Windows and Linux.

0

Symfony Insight

  • Type: service

Detect security risks, find bugs and provide actionable metrics for PHP projects.

0

Synopsys

  • Type: cli

A commercial static analysis platform that allows for scanning of multiple languages (C/C++, Android, C#, Java, JS, PHP, Python, Node.JS, Ruby, Fortran, and Swift).

0

TencentCodeAnalysis

  • Type: service
  • Type: cli
1324

Tencent Cloud Code Analysis (TCA for short, code-named CodeDog inside the company early) is a comprehensive platform for code analysis and issue tracking. TCA consist of three components, server, web and client. It integrates of a number of self-developed tools, and also supports dynamic integration of code analysis tools in various programming languages.

0

Veracode

  • Type: cli

Find flaws in binaries and bytecode without requiring source. Support all major programming languages: Java, .NET, JavaScript, Swift, Objective-C, C, C++ and more.

0

WAP

  • Type: cli

Tool to detect and correct input validation vulnerabilities in PHP (4.0 or higher) web applications and predicts false positives by combining static analysis and data mining.

-1

APPscreener

  • Type: cli

Static code analysis for binary and source code - Java/Scala, PHP, Javascript, C#, PL/SQL, Python, T-SQL, C/C++, ObjectiveC/Swift, Visual Basic 6.0, Ruby, Delphi, ABAP, HTML5 and Solidity.

-1

emerge

  • Type: cli
  • Type: web
390

Emerge is a source code and dependency visualizer that can be used to gather insights about source code structure, metrics, dependencies and complexity of software projects. After scanning the source code of a project it provides you an interactive web interface to explore and analyze your project by using graph structures.

-2

DevSkim

  • Type: ide-plugin
760

Regex-based static analysis tool for Visual Studio, VS Code, and Sublime Text - C/C++, C#, PHP, ASP, Python, Ruby, Java, and others.

-2

Understand

  • Type: cli

Code visualization tool that provides code analysis, standards testing, metrics, graphing, dependency analysis and more for Ada, VHDL, and others.

-3

ShiftLeft Scan

  • Type: cli
  • Type: service
548

Scan is a free open-source DevSecOps platform for detecting security issues in source code and dependencies. It supports a broad range of languages and CI/CD pipelines.

Deprecated/unmaintained tools

2

phpdcd

  • Type: cli
407

Dead Code Detector (DCD) for PHP code.

1

pfff

  • Type: cli
190

Facebook's tools for code analysis, visualizations, or style-preserving source transformation for many languages.

1

php7cc

  • Type: cli
1546

PHP 7 Compatibility Checker.

1

php7mar

  • Type: cli
791

Assist developers in porting their code quickly to PHP 7.

0

PT.PM

  • Type: cli
58

An engine for searching patterns in the source code, based on Unified AST or UST. At present time C#, Java, PHP, PL/SQL, T-SQL, and JavaScript are supported. Patterns can be described within the code or using a DSL.

0

shipshape

  • Type: cli
262

Static program analysis platform that allows custom analyzers to plug in through a common interface.

❤️ Sponsor this project

We are currently looking for partners who want to sponsor hosting and development of the project.

Check out our Github Sponsors page here

Missing an entry? Please let us know.