Download Latest Version 2.1.46 source code.tar.gz (3.9 MB)
Email in envelope

Get an email when there's a new version of PHPStan

Home / 2.1.45
Name Modified Size InfoDownloads / Week
Parent folder
phpstan.phar 2026-03-30 26.3 MB
phpstan.phar.asc 2026-03-30 833 Bytes
2.1.45 source code.tar.gz 2026-03-30 3.9 MB
2.1.45 source code.zip 2026-03-30 3.9 MB
README.md 2026-03-30 5.1 kB
Totals: 5 Items   34.1 MB 0

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 🐛

  • Fix: errors for argument array template types no longer reported (argument.type) (#5300), [#14138], thanks @VincentLanglet and @staabm!
  • Fix: Result of function_exists() can't be "cached" (#5303), [#14384], thanks @staabm and @VincentLanglet!
  • Fix: Optional templated args not provided cause unbound template errors (#5175), [#2572], [#7704], [#9360], thanks @staabm and @VincentLanglet!
  • Resolve generic parameter defaults that reference other template parameters (#5304), thanks @JanTvrdik!
  • Fix: array_filter with assert-if-true callable marks all keys optional (#5097), [#11730], thanks @staabm and @VincentLanglet!
  • Fix: assign.readOnlyProperty (#5061), [#12253], thanks @VincentLanglet and @staabm!
  • Fix: Bogus write-only error when appending to an array-like object in private class property (#5102), [#6777], thanks @VincentLanglet and @staabm!
  • Fix: Cannot use "T is never" in conditional return (#5082), [#9634], [#10938], thanks @VincentLanglet and @staabm!
  • Fix: [NAN] === mixed is always evaluated as false (#5321), [#11054], thanks @staabm and @VincentLanglet!
  • Fix: Parameter [#2] $callback of function uasort expects callable(Foo, Foo): int, 'strnatcasecmp' given. (#5171), [#11619], thanks @VincentLanglet and @staabm!
  • Fix: Does not warn about non-nullable class-property (#5327), [#14393], [#4846], thanks @VincentLanglet and @staabm!
  • Fix: Incorrect inference of instance variable modified from callback (#5347), [#8926], [#11417], [#10903], thanks @staabm and @VincentLanglet!
  • TypeSpecifier: resolve purity/impurity for CallableParametersAcceptor (#5348), [#12686], [#3770], [#6822], thanks @staabm and @VincentLanglet!
  • filter_var: Fix throw on failure with require/force array (#5349), thanks @VincentLanglet!
  • Fix: FILTER_FLAG_GLOBAL_RANGE constant not "known" on PHP 8.3, 8.4 (#5334), [#14397], thanks @VincentLanglet and @staabm!
  • Fix: Narrowed template on an interface is ignored when generics is not specified (#5339), [#9045], [#7185], [#13204], thanks @VincentLanglet and @staabm!
  • Fix: Consequent scope with the same condition (#5056), [#4173], [#12992], [#14227], thanks @VincentLanglet and @staabm!

Performance 🏎️

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

Internals 🔍

Source: README.md, updated 2026-03-30