PHPStan 2.0 has been released and how to get a new ElePHPant!

PHPStan 2.0 has been released and how to get a new ElePHPant!

Earlier this week, Ondřej Mirtes creator of PHPStan released PHPStan 2.0 🥳

PHPStan 2.0 Released With Level 10 and Elephpants!

PHPStan is one of my absolute favourite PHP tools and has saved me so many times by highlighting issues that I just didn't think about when writing my code. By hooking it into your CI/CD pipeline, you can be sure that issues get flagged before they reach production!

So what's new?

Well, the article I linked above does an excellent job of highlighting everything that is new with PHPStan 2.0, but a couple of things worth mentioning are:

Level 10

Previously, PHPStan would have a max level of level 9, once that was passing, then that was really it! PHPStan 2.0 introduces an extra level, so for all of your codebases that are level 9, sorry, you're no longer the max level!

Memory Consumption Improvements

Improvements have been made in PHPStan 2.0 so that it no longer eats memory like there's no tomorrow. I remember having issues when I first started using PHPStan where my CI/CD pipeline would stop part way through because of memory issues, I'm glad these have been resolved. The article above goes into how this was achieved but I'm sure everyone would agree with me when I say, it's a much welcomed change!


There's now an extra way to support PHPStan aside from starring on Github and donating via Github Sponsors. Introducing, PHPStan Merch where you can buy ElePHPants and T-Shirts.

I decided to go with 3 ElePHPants and 1 of the T-Shirts. If you buy an ElePHPant you also get a nice little bonus of 4 PHPStan stickers with each one. I'll be keeping one for my Herd but the other two I'll be putting up as trade fodder.

If you use PHPStan, consider supporting to allow development to continue!

💡
The ElePHPant and T-Shirt sale has ended since I put this post up. Whilst I can't help with T-Shirts, I can help with ElePHPants. If you're in need of one, I will have 2 to trade. Get in touch via Twitter and we can arrange a trade once they arrive (sometime in 2025).