PHP Code Sniffer VS PHPStan

Compare PHP Code Sniffer vs PHPStan and see what are their differences.

PHP Code Sniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards. (by PHPCSStandards)

PHPStan

PHP Static Analysis Tool - discover bugs in your code without running it! (by phpstan)
JetBrains - Tell us how you use coding tools. You may win a prize!
Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!
surveys.jetbrains.com
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
PHP Code Sniffer PHPStan
49 66
1,323 13,569
2.6% 0.4%
9.7 9.9
7 days ago 5 days ago
PHP PHP
BSD 3-clause "New" or "Revised" License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

PHP Code Sniffer

Posts with mentions or reviews of PHP Code Sniffer. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-12-23.

PHPStan

Posts with mentions or reviews of PHPStan. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2025-08-21.
  • Enhancing Laravel Code Quality with Larastan
    2 projects | dev.to | 21 Aug 2025
    It internally uses PHPStan, one of the most respected tools for static analysis in PHP.
  • Laravel Filament Multipanel Starter - Build your app fast
    6 projects | dev.to | 30 Jul 2025
    PHPStan for static analysis
  • Code Quality Check with PHPStan
    1 project | dev.to | 25 Jul 2025
    Ensuring clean, maintainable code is vital in any Laravel project. While PHPStan is an excellent static analysis tool for identifying code issues, the raw JSON output it generates isn’t always human-friendly. That’s where a custom reporting script comes in handy.
  • Laravel Filament Backend Starter – Build your admin panel fast
    5 projects | dev.to | 24 Jul 2025
    Dev-friendly tools with Laravel Debugbar, PHPStan for static analysis and Pint for consistent code formatting
  • PHP: errors to avoid with constructors
    2 projects | dev.to | 4 Mar 2025
    PHPStan: composer require --dev phpstan/phpstan
  • Build a Symfony 7 boilerplate using FrankenPHP, Docker, PostgreSQL and php 8.4
    11 projects | dev.to | 23 Dec 2024
    To do so simply install the runtime/frankenphp-symfony composer package. Then we install the bare minimum for a kick ass developer experience, a linter using Code Sniffer, phpstan as code quality audit tool, Rector to ease and automate code maintenance, some useful Symfony components and package and of course the Doctrine ORM. Here the composer.json file located at the symfony folder root.
  • How to Avoid Adding New Code that Uses Deprecated Code?
    2 projects | dev.to | 25 Jun 2024
    At DinnerBooking, we've tackled this challenge using PHPStan. Here’s how:
  • Rector keeps your PHP code base fresh and perfect
    2 projects | dev.to | 15 Mar 2024
    As part of the journey to PHP perfection, you should embrace Rector. It's a amazing, free, and open-source tool for migrations, code quality, type coverage, pushing PHPStan to the highest levels, and yes, it can even auto-fix your existing code! It seamlessly integrates into the CI process, making your development workflow smoother than ever.
  • 8 Essential Tools Every PHP Developer Needs
    6 projects | dev.to | 27 Feb 2024
    PHPStan focuses on finding errors in PHP code without running it. It captures all types of errors, even before you write tests. It brings PHP closer to compiled languages by checking the correctness of each line of code before execution.
  • Laravel code-quality tools
    16 projects | dev.to | 8 Feb 2024
    PHPStan is a static analysis tool for PHP. Larastan is a package built on top of PHPStan to make it easier to integrate with Laravel projects. PHPStan works by "sniffing" the code using the various rulesets applied to it and determine if it follows the standards. However, Larastan doesn't fully follow the definition of "static analysis" since it has to boot the application's container and resolve the types that can only be computed at runtime. This is why Larastan is called a "code analysis" tool rather than a "static analysis" tool.

What are some alternatives?

When comparing PHP Code Sniffer and PHPStan you can also consider the following projects:

PHP CS Fixer - A tool to automatically fix PHP Coding Standards issues

Psalm - A PHP static analysis tool for finding errors and security vulnerabilities in PHP applications

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.

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

GrumPHP - A PHP code-quality tool

JetBrains - Tell us how you use coding tools. You may win a prize!
Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!
surveys.jetbrains.com
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured