Download Latest Version 2.2.7 source code.zip (11.9 MB)
Email in envelope

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

Home / 2.2.4
Name Modified Size InfoDownloads / Week
Parent folder
phpstan.phar 2026-07-03 27.3 MB
phpstan.phar.asc 2026-07-03 833 Bytes
2.2.4 source code.tar.gz 2026-07-03 4.1 MB
2.2.4 source code.zip 2026-07-03 4.1 MB
README.md 2026-07-03 2.1 kB
Totals: 5 Items   35.4 MB 2

PHPStan addresses the RAMpocalypse! It now consumes a lot less memory. See for yourself by running analyse -v.

E.g. running PHPStan on itself went from 2.8 GB to 2.1 GB total consumed memory across worker processes.

Bugfixes 🐛

  • Skip boolean conditional holders whose target was dropped as a no-op antecedent narrowing (#5958), [#14891], thanks @VincentLanglet!
  • Distrust a TemplateType member's eager Yes in IntersectionType::isAcceptedBy only when that member accepts with Yes (#5962), [#14893], thanks @staabm!
  • Forget the tracked ob_get_level() after impure calls that may open or close output buffers (#5964), [#14895], thanks @staabm and @VincentLanglet!

Performance 🏎️

  • PackageDependencyResolver: memoize resolvePackage per file (#5961), thanks @SanderMuller!
  • Evict parser and PHPDoc name-scope caches by LRU instead of FIFO (#5965)
  • Remove custom isSuperTypeOf reasons from ObjectType (#5968), [#14896]
  • Restore value sharing in name scope maps hydrated from the file cache (#5969)
  • Cap CachedParser by total cached source size (#5969)
  • Keep a single memoization layer for located reflections (#5974)
  • Stream the result cache to disk instead of building it in memory (https://github.com/phpstan/phpstan-src/commit/ee9fe9e40d8f544ea2cbd83e372c79c82cfd9457)

Internals 🔍

  • Upload coverage report artifacts (#5950), thanks @staabm!
  • Reduce memory_limit (#5971), thanks @staabm!
Source: README.md, updated 2026-07-03