PHP Static Analysis Tool - discover bugs in your code without running it!
$ npx -y skills add phpstan/phpstan --agent claude-code
Run the curl in your terminal, the rest in Claude Code.
What's inside
PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.
Try out PHPStan on the on-line playground! »
Want your logo here? Learn more »
You can sponsor my open-source work on PHPStan through GitHub Sponsors and also directly.
One-time donations through Revolut.me are also accepted. To request an invoice, contact me through e-mail.
All the documentation lives on the phpstan.org website:
PHPStan Pro is a paid add-on on top of open-source PHPStan Static Analysis Tool with these premium features:
Try it on PHPStan 0.12.45 or later by running it with the --pro option. You can create an account either by following the on-screen instructions, or by visiting account.phpstan.com.
After 30-day free trial period it costs 7 EUR for individuals monthly, 70 EUR for teams (up to 25 members). By paying for PHPStan Pro, you're supporting the development of open-source PHPStan.
You can read more about it on PHPStan's website.
This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you are expected to uphold this code.
Any contributions are welcome. PHPStan's source code open to pull requests lives at phpstan/phpstan-src.
.claude/
skills/
analyse-with-phpstan/
SKILL.md
run-on-3v4l/
SKILL.md
.editorconfig
.gitattributes
.github/
actionlint-matcher.json
actionlint.yaml
FUNDING.yml
ISSUE_TEMPLATE/
Bug_report.yaml
config.yml
Feature_request.yaml
Function_signature_mismatch.md
mergeable.yml
renovate.json
SECURITY.md
workflows/
algolia-crawler-config.json
algolia-crawler-config.yml
build-identifier-extractor.yml
claude-easy-fix-on-milestone.yml
claude-react-on-review-dispatch.yml
claude-react-on-review.yml
claude-update-error-docs-identifiers-change.yml
docker-nightly.yml
docker-stable.yml
extension-tests-run.yml
extension-tests.yml
extract-identifiers.yml
integration-tests-run.yml
integration-tests.yml
lint-workflows.yml
lock-closed-issues.yml
other-tests-run.yml
other-tests.yml
release-toot.yml
release-tweet.yml
release.yml
spelling.yml
sponsors.yml
test-projects.yml
tests.yml
update-playground-api.yml
update-playground-runner.yml
website-infra.yml
website-links.yml
website.yml
.gitignore
.idea/
icon.png
.phar-checksum
.typos.toml
BACKERS.md
bootstrap.php
CHANGELOG.md
CLAUDE.md
CODE_OF_CONDUCT.md
composer.json
conf/
bleedingEdge.neon
docker/
Dockerfile.php.8.0
Dockerfile.php.8.1
Dockerfile.php.8.2
Dockerfile.php.8.3
Dockerfile.php.8.4
Dockerfile.php.8.5
e2e/
alias-event/
alias.php
test.php
api-platform-trait/
.gitignore
composer.json
test.php
attribute-74/
test.neon
test.php
attributes/
php80.neon
test.php
autoload-better-reflection/
test.php
autoload-psr/
app/
autoload.php
index.php
libs/
Foo/
Baz.php
autoloader-issue-stream-eof/
.gitignore
composer.json
phpstan.neon
src/
Foo.php
autoloader-require/
phpstan.neon
README.md
src/
bootstrap.php
ClassA.php
ClassAHelperTrait.php
tests/
ClassATest.php
ClassATestWithUse.php
baseline/
phpstan-baseline.neon
phpstan.neon
src/
Test.php
Test2.php
bug-10023/
.gitignore
composer.json
composer.lock
phpstan-bootstrap.php
phpstan.neon.dist
src/
Consumer.php
Impl.php
InterfaceExists.php
test.php
bug-9574/
test/
phpstan.neon
test.php
bug3634/
.gitignore
app/
phpstan.neon
src/
MyApp.php
composer-classes/
HttpResponse.php
composer.json
composer.lock
bug6933/
.gitignore
composer.json
composer.lock
Module/
Article/
DataProvider/
AbstractProvider.php
RegOwnerSteps.php
bug7308/
.gitignore
app/
bootstrap.php
phpstan.neon
src/
MyApp.php
composer-classes/
ExternalClass.php
composer.json
composer.lock
bug7365/
app/
bootstrap.php
phpstan.neon
src/
MyApp.php
autoloaded-classes/
ExternalClass.php
not-autoloaded-classes/
ClassWithConstants.php
bug7441/
.gitignore
app/
phpstan.neon
repro.php
composer.json
composer.lock
preload.php
bug7960/
.gitignore
app/
phpstan.neon
repro.php
composer.json
composer.lock
setup-autoloader.php
bug8054/
application/
fare.de/
Bootstrap.php
phpstan-bootstrap.php
phpstan.neon.dist
public/
fare.de/
boot.php
bug8610/
autoloader.php
classes/
A.php
phpstan-baseline.neon
phpstan.neon
trigger-autoload.php
bug8778/
.gitignore
classes/
A.php
SomeService.php
composer.json
other.neon
phpstan-baseline.neon
phpstan.neon
bug9714/
bug9714.php
composer-file/
.gitignore
composer.json
function.php
test.php
composer.json
composer.lock
data/
strictRulesExtension-0.json
strictRulesExtension.php
different-php-parser/
.gitignore
composer.json
phpstan.neon
src/
Foo.php
test.php
different-php-parser2/
.gitignore
composer.json
src/
ShouldWork.php
different-phpdoc-parser/
.gitignore
composer.json
phpstan.neon
Test.php
discussion-8502/
.gitignore
composer.json
composer.lock
extension.neon
src/
FooTypeNodeResolverExtension.php
stubs/
Container.stub
tests/
BarTest.php
data/
bug1.php
bug2.php
FooTest.php
tests.neon
dup-classes/
lib/
admin/
defaultActions.php
public/
defaultActions.php
phpstan.neon.dist
event-dispatcher/
.gitignore
composer.json
composer.lock
phpstan.neon
test.php
excludePaths/
phpstan.neon
src/
foo.php
thirdparty/
Bar.php
excludePaths2/
phpstan.neon
src/
broken/
broken.php
foo.php
thirdparty/
ThirdpartyClass.php
filter-extension-stub-files/
.gitignore
composer.json
composer.lock
deploy/
app/
services/
phpstantest.php
phpstan.neon
README.md
filter-phar-stub-files/
phpstan.neon
src/
test.php
google_service/
.gitignore
composer.json
composer.lock
phpstan.neon
test.php
hoa-autoload/
.gitignore
composer.json
composer.lock
phpstan.neon
test.php
integration/
.gitignore
better-reflection-baseline.neon
better-reflection.neon
bladestan-baseline.neon
bladestan-composer.lock
bladestan.neon
carbon-baseline.neon
carbon.neon
composer-baseline.neon
composer.neon
doctrine-collections-baseline.neon
doctrine-collections.neon
doctrine-dbal-baseline.neon
doctrine-dbal.neon
doctrine-orm-baseline.neon
doctrine-orm.neon
doctrine-persistence-baseline.neon
doctrine-persistence.neon
drupal-baseline.neon
drupal.neon
editor-link-repo.php
efabrica-phpstan-latte-baseline.neon
efabrica-phpstan-latte.neon
flow-baseline.neon
flow-legacy-baseline.neon
flow-legacy.neon
flow.neon
larastan-baseline.neon
larastan-composer.lock
larastan.neon
laravel-baseline.neon
laravel-types-baseline.neon
laravel-types.neon
laravel.neon
magento-baseline.neon
magento-testcase-baseline.neon
magento-testcase.neon
magento.neon
neos-baseline.neon
neos.neon
nextras-baseline.neon
nextras.neon
php-parser-baseline.neon
php-parser.neon
phpcs-baseline.neon
phpcs.neon
phpstan-dba-baseline.neon
phpstan-dba.neon
phpunit-baseline.neon
phpunit.neon
pocketmine-constants.php
pocketmine-ng-baseline.neon
pocketmine-ng.neon
prado-baseline.neon
prado.neon
prestashop-baseline.neon
prestashop.neon
react-promise-baseline.neon
rector-baseline.neon
rector-composer.lock
rector-downgrade-php-baseline.neon
rector-downgrade-php-composer.lock
rector-downgrade-php.neon
rector.neon
shipmonk-dead-code-detector-baseline.neon
shipmonk-dead-code-detector.neon
shipmonk-rnd-baseline.neon
shipmonk.neon
shopsys-baseline.neon
shopsys-composer.lock
shopsys-project-base-baseline.neon
shopsys-project-base-composer.lock
shopsys-project-base.neon
shopsys.neon
shopware-baseline.neon
shopware.neon
slevomat-cs-baseline.neon
slevomat-cs.neon
sylius-baseline.neon
sylius-composer.lock
sylius.neon
symplify-baseline.neon
symplify-composer.lock
symplify.neon
webmozart-assert-baseline-lvl9.neon
webmozart-assert-baseline.neon
webmozart.neon
wordpress-baseline.neon
wordpress.neon
... 1600 moreShowing a partial view of a very large repo.
FAQ
phpstan is a Claude Code plugin with 2 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes analyse-with-phpstan, run-on-3v4l. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.