Skip to content

Releases: phpstan/phpstan

2.1.47

13 Apr 15:59
7901544

Choose a tag to compare

Major new features 🚀

  • bisect command (#5431), #14443
    • Find the first PHPStan commit that introduced a regression
    • This command performs a binary search over PHPStan releases, similar to git bisect
    • Learn more »

Improvements 🔧

Bugfixes 🐛

Performance 🏎️

Internals 🔍

2.1.46

01 Apr 09:26
a193923

Choose a tag to compare

Improvements 🔧

Bugfixes 🐛

Performance 🏎️

2.1.45

30 Mar 13:25
f8cdfd9

Choose a tag to compare

This release fixes 29 issues!

In other news, we refreshed the on-line playground! You can now set many previously-unavailable config parameters:

Screenshot 2026-03-30 at 15 24 48

This helps you testing out various PHPStan features, and also reproduce issues for bug reports when something goes wrong with these parameters set to their non-default values.

Also, there's a couple of new blogposts on the website:

Improvements 🔧

Bugfixes 🐛

Performance 🏎️

  • Flatten deep BooleanOr chains in TypeSpecifier to avoid O(n^2) recursion (#5324), thanks @SanderMuller!

Internals 🔍

2.1.44

25 Mar 17:40
4a88c08

Choose a tag to compare

Bugfixes 🐛

2.1.43

24 Mar 21:05
d01bebe

Choose a tag to compare

Another week, 37 issues crushed!

Improvements 🔧

Bugfixes 🐛

Performance 🏎️

Function signature fixes 🤖

  • Fix return type of PDOStatement::debugDumpParams() (#5273), thanks @mttsch!

Internals 🔍

2.1.42

17 Mar 15:01
1279e1c

Choose a tag to compare

Fix #14305: Internal error crash report (phpstan/phpstan-src#5231), thanks @staabm and @VincentLanglet!

2.1.41

16 Mar 18:27
a2eae8f

Choose a tag to compare

Just three weeks after PHPStan 2.1.40, this release fixes whopping 87 issues! 🎉

Major new features 🚀

Improvements 🔧

Bugfixes 🐛

Read more

1.12.33

28 Feb 20:31
37982d6

Choose a tag to compare

Suggest to coding agents that PHPStan 2.x is available to upgrade to from 1.12.x (phpstan/phpstan-src@8c66d82)

2.1.40

23 Feb 15:06
9b2c7ae

Choose a tag to compare

This release fixes 71 issues! 🎉

It's only been 12 days since the last release, but both @staabm and @VincentLanglet have been hard at work. For the first time ever, PHPStan has more people with merge rights aside from @ondrejmirtes, and the increase in productivity is awesome!

Improvements 🔧

  • Introduce rawMessages key in ignoreErrors (#4929), thanks @VincentLanglet!
  • Infer non-empty-ness after count($a) == count($b) (#4470), thanks @staabm!
  • Report class.nameCase error when the wrong case is just in return type (#4890), #11470
  • Allow ternary type narrowing in assert and truthy contexts (#4915), #14100
  • Add ClassConstantReflection::isFinalByKeyword() method (#5022), #14171, thanks @samsonasik!

Bugfixes 🐛

Performance 🏎️

  • Faster NetteContainer (#4921), thanks @staabm!
  • MutatingScope: prevent unnecessary work in removeTypeFromExpression() (#4922), thanks @staabm!
  • Don't invalidate container cache on user-interactions in the shell (#4924), thanks @staabm!
  • Prevent duplicate path normalization (#4931), thanks @staabm!
  • DependencyResolver: Reduce duplicate work (#4923), thanks @staabm!
  • speed up TrinaryLogic (#4833), thanks @kaja47!
  • ClassNameCheck: Retrieve extensions just once (#4926, #5027), thanks @staabm!
  • IsSuperTypeOfResult: cache YES/NO/MAYBE (#5011), thanks @staabm!
  • Faster IntersectionTypeMethodReflection->getVariants() (#5012), thanks @staabm!
  • ArgumentsNormalizer: remove duplicated work (#5010), thanks @staabm!
  • Faster AcceptsResult, IsSuperTypeOfResult (#5013), thanks @staabm!
  • TypeSpecifier: Prevent duplicate expression printing (#5018), thanks @staabm!
  • Faster Ternary analysis (#5015), thanks @staabm!

Function signature fixes 🤖

  • Add @param-out for getmxrr (#4943), #10704, thanks ...
Read more

2.1.39

11 Feb 14:49
c6f73a2

Choose a tag to compare

Bleeding edge 🔪

  • Require generics for Iterator, IteratorAggregate, Generator (#4209), thanks @Flyingmana!

If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's phpstan.neon:

includes:
	- vendor/phpstan/phpstan/conf/bleedingEdge.neon

Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more

Improvements 🔧

Bugfixes 🐛

Performance 🏎️

  • NodeScopeResolver: faster produceArrayDimFetchAssignValueToWrite() (#4842), thanks @staabm!
  • NodeScopeResolver: Prevent repetitive union of static types (#4841, #4843), thanks @staabm!
  • Prevent repetitive calls to ParametersAcceptorSelector::selectFromArgs() (#4855) (#4855), thanks @staabm!
  • MutatingScope: prevent unnecessary scope re-creation after openssl* calls (#4854) (#4854), thanks @staabm!
  • Made closures php-src cachable (#4724), thanks @staabm!
  • VoidToNullTraverser: Intersections cannot contain void (#4868), thanks @staabm!
  • Prevent unnecessary type-traversal (#4868), thanks @staabm!

Function signature fixes 🤖

Internals 🔍