Find bugs in your code without writing tests! Created by @OndrejMirtes

Joined July 2016
If all the govs shutting down servers for a PHP update, all the hosters & enterprises terrified by the vuln, gave $100k, or just $50k a year to the PHP Foundation, things could look very differently. Go, make your employer sponsor *today* thephp.foundation/sponsor/ #php #phpc @ThePHPF
2
111
9
220
12,948
Caching Composer dependencies in GitHub Actions is easy thanks to the lock file. But what about a tool like PHPStan that has no lock file to hash? masteringlaravel.io/daily/20…
1
2
3
559
Before: oh, the Symfony DIC changed slightly, let’s nuke the whole result cache Now: we changed parameter X in Symfony config, the result cache will reanalyse only the files asking about it
#phpstan 2.3.x added new dependency tracking APIs which allow custom extensions/rules to declare values/files they depend on. todays #phpstandba 0.5 release uses the new APIs, which allows us to re-analyze only code depending on the database schema when it changes.
3
13
1,421
I wanted to stop controllers calling external services, however deep in the call graph. So I built a PHPStan extension: mark external calls as 'slow', forbid 'slow' in controllers, and let it flag violations. Probably has many other uses too. github.com/DaveLiddament/php…
3
6
26
1,193
Same performance, smaller package PHPStan 2.3.0 was chonky! It weighed 104 MB when downloaded and 268 MB after being unzipped in your vendor/. I just released PHPStan 2.3.1 that weighs just under 28 MB when downloaded and 87 MB unzipped. While preserving all the Turbo binaries.
10
10
162
6,253
PHPStan analysing the WordPress codebase took 60.51 seconds back in december. With PHPStan 2.3 + Turbo: 7.93 seconds. That’s the kind of dev improvement I get excited about💪
3
3
21
845
PHPStan retweeted
Tried PHPStan 2.3.0 on our Laravel 13 project: cold analysis dropped from 40.86s to 17.88s with Turbo enabled — 2.29× faster! Same code/config, up to 6 workers. Thanks for the release! ** switched PHP 8.4 ZTS → NTS to enable Turbo. Warm cache: ~1.6s in both.
PHPStan 2.3.0 is out with massive leap in performance, generics improvements, detecting unused variables, improved closure type inference, inferring static variable types from assignments, and engine rewrite!
2
4
1
11
859
PHPStan retweeted
Replying to @OndrejMirtes
@OndrejMirtes wasn't kidding with the speed improvement 🤯 it also uses less memory
PHPStan is now way faster so we can all PHPFaster 🚀
1
4
5
359
Ran PHPStan 2.3.0 on my work codebase, a large funeral services ERP (5,600+ files, 550k lines of Laravel), and asked the AI to chart the difference. Full cold analysis: 52.7s → 14.8s. 3.6× faster That's impressive work. It also caught 5 new real errors.
4
3
296
PHPStan retweeted
m@ttias ⚡️
@mattiasgeniarOct 6
No-brainer upgrade, the testsuite for getsnapkin.app/ just got cut in half with zero effort 🥳 The PHPStan blogpost is also a marvel to read 👏
PHPStan 2.3.0 is out with massive leap in performance, generics improvements, detecting unused variables, improved closure type inference, inferring static variable types from assignments, and engine rewrite!
4
10
1,114
The initial feedback has been encouraging!
2
2
586
Have you ever declared a static variable that you forgot to assign to at all? 😉
1
1
5
666
The interactive widgets in the article are useful when trying to understand what the new features do to inferred types:
1
1
7
738
PHPStan retweeted
PHPStan is now way faster so we can all PHPFaster 🚀
PHPStan 2.3.0 is out with massive leap in performance, generics improvements, detecting unused variables, improved closure type inference, inferring static variable types from assignments, and engine rewrite!
3
1
4
673
PHPStan 2.3.0 is out with massive leap in performance, generics improvements, detecting unused variables, improved closure type inference, inferring static variable types from assignments, and engine rewrite!
8
32
5
185
11,540
Had an idea today after lunch and basically one-shotted a solution for the currently most-upvoted PHPStan feature request:
1
2
24
2,891
After my summer break I am back at my primary job. Started updating #phpstan in our closed source projects CI. one example: PHPStan 2.2.5: 70s PHPStan 2.2.14: 37s nice to see our recent #performance focus pays off in real world projects 🚀
2
9
556
PHPStan level 8 on Laravel is brutal but worth it. Went from 0 to 8, then applied the pattern to 4 projects for now. Caught real bugs, not style nits.
1
3
15
626
PoV: Your PHPStan pull request is about to be merged 🚀
3
2
26
2,344