PHP Testing and Code Quality Tools
Test runners, static analysers and code fixers for PHP: PHPUnit, Pest, PHPStan, Psalm, Pint, PHP CS Fixer, Rector and Infection, and what to pick first.
Updated
Start with PHPUnit or Pest for tests, then add PHPStan for the bugs tests miss, and a style fixer (Pint for Laravel, PHP CS Fixer elsewhere) so reviews skip formatting. Psalm is the alternative analyser, Rector helps with upgrades, and Infection is worth adding only after your coverage is already good.
- ToolFree
PHPUnit (opens in a new tab)
The standard PHP test framework, now at version 13. Best when you want the tool nearly every library and framework already uses, or you are maintaining an existing test suite.
Checked
- ToolFree
Pest (opens in a new tab)
A test framework with a compact syntax, currently at version 5. Suits Laravel teams who want tests that read quickly and are happy to start fresh.
Checked
- ToolFree
PHPStan (opens in a new tab)
A static analyser that finds type errors and dead code without running anything. Start at a low level and raise it over time; best first tool for most existing projects.
Checked
- ToolFree
Psalm (opens in a new tab)
A static analyser with security-focused taint analysis and an online playground. Pick it over PHPStan if you want the security checks, or already use it.
Checked
- ToolFree
Laravel Pint (opens in a new tab)
An opinionated code style fixer built on PHP CS Fixer, included with new Laravel apps. Best for Laravel projects that want formatting settled with no configuration.
Checked
- ToolFree
PHP CS Fixer (opens in a new tab)
Fixes code style automatically against rule sets such as PSR-12 and Symfony. Suits projects outside Laravel, or teams that want to control every rule.
Checked
- ToolFree
Rector (opens in a new tab)
Automates PHP version upgrades and refactoring through rules. Best for legacy code you want on a current PHP version; the team also sells paid upgrade work.
Checked
- ToolFree
Infection (opens in a new tab)
A mutation testing tool that changes your code and checks whether your tests notice. Use it once coverage is high and you doubt the tests actually catch anything.
Checked
We opened each address on the date shown. No link here is an affiliate link.
More resources
- PHP News and Newsletters
Where to keep up with PHP: the official release news, a weekly newsletter, and the blogs that track new versions, RFCs, releases and security fixes.
- PHP Frameworks and Official Documentation
Where to read the PHP manual and the docs of Laravel, Symfony, Livewire, Slim, CodeIgniter and CakePHP, with a note on which framework suits which project.
- PHP Communities and Forums
Where PHP developers ask, answer and meet: forums for Laravel and Symfony, the official mailing lists, and the places to find a PHP group near you.
- PHP Developer Blogs
Blogs by PHP developers themselves: Laravel and package authors, the Xdebug author, and the teams behind PhpStorm and Slim, on code, tools and production PHP.
- PHP Videos and Courses
Video courses and conference talks for learning PHP and Laravel: series for beginners, deep dives for working developers, and talks from PHP conferences.
- PHP Deployment and Hosting Tools
Tools for getting PHP and Laravel apps online: Laravel Cloud, Forge, Ploi, Envoyer, Coolify, Deployer and FrankenPHP, and how to choose between them.
- PHP Editors, Language Servers and Debugging
Editors and add-ons for PHP work: PhpStorm, VS Code, Intelephense, DEVSENSE PHP Tools, Phpactor and Xdebug, and which to pick for your setup and budget.