You're missing out if you're not on PHPStan 2.3.6


Hello everyone,
it's been a while since the last newsletter, in fact, I only ever sent out a PHPStan newsletter when the boxes with 950 elephpants arrived here at PHPStan HQ in May 2025 πŸ˜…

I don't know how many of you pay close attention to PHPStan's blog and release notes and whether you are running the latest PHPStan version, which is always the best version. This is me making sure you know how awesome our updates have been this year, and what you're missing out on if you're staying on PHPStan 2.2.*, or worse, 2.1.*, or infinitely worse, some version starting with 1 😱

So I'm going to pick a few of my favourite features and improvements that will make you feel like you should run composer update phpstan/phpstan or even composer require --dev phpstan/phpstan:^2.3 if you're still on 1.x. In that case don't forget to follow the upgrading guide too.

PHPStan got 7.5Γ— faster in 2026

We've been hard at work improving PHPStan's performance. What took 60 seconds in January 2026 now takes only 8 seconds.

The blue line is improvement in plain PHP, from 60 seconds to 20 seconds over the course of 10 months. The orange line is PHPStan Turbo, a native PHP extension that makes PHPStan faster for everyone by additional 60 percent. If you install PHPStan through Composer, the chances are you're already using it. You can read more about Turbo and you can check out commented slides from my presentation about Turbo.

But making raw PHPStan performance faster isn't even the whole story. There's also the result cache. If you run PHPStan, then edit a few files, and run PHPStan again, you're not going to wait the same amount of time as before, it's going to be much faster. PHPStan decides which files need to be analysed since the last time it ran, and over the past year we've been making sure it's faster at that too.

Auto-fixable rules

PHPStan now tells you with a little πŸ”§ icon when a reported error can be fixed automatically by re-running PHPStan with --fix. Some core PHPStan rules already support fixing their reported errors, like the ones that report missing #[Override] attribute.

You can also implement automatic fixes in your custom rules.

But the feature currently most shines in cleaning up your obsolete ignoreErrors and the baseline. Having PHPStan reporting:

Ignored error pattern was not matched in reported errors.
Ignored error pattern is expected to occur 4 times, but occurred only 3 times.

...was always pretty frustrating, I agree with that. But now you can just run --fix and the ignores will be erased and expected counts will be updated.

Unsealed array shapes

Array shapes are one of the most popular PHPStan features. I guess because arrays are one of the most popular PHP features πŸ˜…

You can use them to precisely describe type of each key in arrays flowing through your application: array{foo: int, bar: string}

But for a long time you couldn't describe "an array has this specific keys, but it can have more keys of this type". Well since PHPStan 2.2, you can: array{foo: int, bar:string, ...

And if you enable Bleeding Edge, all your array shapes by default become sealed. Learn more about unsealed array shapes here.

PHPStan for your Twig templates

Try out TwigStan. It runs PHPStan on your Twig templates compiled into PHP and can point out the same useful errors you're used to when running it on (or over? 🚧) your code.

...and there's much much more

I feel like this email could be almost infinite, there's so much much more, but I have to stop somewhere. I'll add a few more bullet points for you to check out if you're interested:


Don't hesitate to reply to this email and tell me what you thought about it πŸ˜‰

Until next time,
​OndΕ™ej MIrtes

PHPStan s.r.o.

PHPStan finds bugs in your code without writing tests. It's open-source and free.

Read more from PHPStan s.r.o.