Skip to content

Releases: phpstan/phpstan

2.1.53

28 Apr 16:16
ef67586

Choose a tag to compare

Bugfixes 🐛

  • Treat Expr\UnaryMinus with scalar operand as scalar literal in isExprSafeToProjectThroughVariable and comparison type specifying (fixes TypeError crash) (#5557), #14542
  • Unroll foreach over union of constant arrays in tryProcessUnrolledConstantArrayForeach (#5558), #7978

2.1.52

28 Apr 12:27
08a34f8

Choose a tag to compare

This release fixes 45 issues! 🎉

Improvements 🔧

  • Emit virtual Assign node for List_ destructuring in foreach value position (#5504), #8075
  • Narrow array key type after type-checking the key variable inside a foreach loop (#5505), #7076
  • Support for static::SOME_CONST in PHPDoc (#5510), #13828, thanks @VincentLanglet!
  • Allow GMP in increment/decrement operations (#5530), thanks @Firehed!

Bugfixes 🐛

Performance 🏎️

Function signature fixes 🤖

Internals 🔍

2.1.51

21 Apr 18:23
dc3b523

Choose a tag to compare

Improvements 🔧

  • Include argument index in dumpType message to preserve argument order (#5503), #14508

Bugfixes 🐛

Internals 🔍

2.1.50

17 Apr 13:11
d452086

Choose a tag to compare

Bugfixes 🐛

Function signature fixes 🤖

2.1.49

16 Apr 21:12
d008295

Choose a tag to compare

Bugfixes 🐛

Performance 🏎️

  • Use pairwise TypeCombinator::intersect folding for conditional expression holders to avoid exponential union distribution (#5482), #14475
  • Fix more cases (#5482), #14475
  • More pair-wise intersect (#5482), #14475
  • Avoid 2^N getAllArrays() expansion in implode() return type extension (#5482), #14475
  • Avoid 2^N getAllArrays() expansion in ConstantArrayType::getFiniteTypes() (#5482), #14475
  • Bail early in TypeUtils::flattenTypes() to avoid 2^N getAllArrays() expansion (#5482), #14475
  • Batch unionWith in specifyTypesForFlattenedBooleanOr falsey path to avoid O(N²) (phpstan/phpstan-src@7eab3d2)
  • Add flattening optimization for deep BooleanAnd chains in truthy context (phpstan/phpstan-src@3f5f2de)
  • Use hash map for O(1) key lookup in ConstantArrayType (phpstan/phpstan-src@8019f65)
  • Fix infinite hang when analysing src/wp-includes/user.php in wordpress-develop (#5485)

Function signature fixes 🤖

  • Update session_set_save_handler $gc parameter (#5474), thanks @sreichel!

Internals 🔍

2.1.48

15 Apr 20:25
2313972

Choose a tag to compare

Improvements 🔧

  • Report promoted properties with readonly or hooks as always unitialized (cannot be unset) (#5452), #14459

Bugfixes 🐛

Performance 🏎️

Internals 🔍

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 🐛