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.5
Name Modified Size InfoDownloads / Week
Parent folder
phpstan.phar 2026-07-05 27.3 MB
phpstan.phar.asc 2026-07-05 833 Bytes
2.2.5 source code.tar.gz 2026-07-05 4.1 MB
2.2.5 source code.zip 2026-07-05 4.1 MB
README.md 2026-07-05 3.2 kB
Totals: 5 Items   35.4 MB 1

Improvements 🔧

Bugfixes 🐛

  • Allow null values in native preg_replace_callback callback array type for PREG_UNMATCHED_AS_NULL (#5987), [#14904], thanks @staabm!

Performance 🏎️

  • Restore process-wide statics from the main container after stub validation (#5984)
  • Drop the container reference in LazyClassReflectionExtensionRegistryProvider after building the registry (#5985)
  • Replace PhpClassReflectionExtension::evictPrivateSymbols() with a shared LRU over the member caches (#5986)
  • Make the member cache LRU limit configurable as cache.memberCacheKeysMax (#5986)
  • LRU-cap resolved local type aliases in UsefulTypeAliasResolver (#5989)
  • Make the cap configurable via cache.resolvedLocalTypeAliasesCountMax (#5989)
  • Raise CachedParser source-byte cap to 4 MB, add eviction floor, make it configurable (https://github.com/phpstan/phpstan-src/commit/354e9266fdb33141401f940d10ce8ffdbf0401d3)
  • Give CachedParser $cachedSourceBytesMax a default value (https://github.com/phpstan/phpstan-src/commit/fa1003aaa5a0e5aaa658430fcbdaf80d238b0428)
  • Flatten deep BooleanOr chains in resolveType() to avoid O(n^2) scope narrowing (#5992), [#14477], thanks @SanderMuller!
  • Cache per-guard isSuperTypeOf() results in createConditionalExpressions() instead of recomputing them per target (#6001), [#14920]
  • Skip constant-array guards when creating conditional expressions for subtype-absorbed targets (#6002), [#14921]
  • Compute ConstantArrayType sealed-shape isSuperTypeOf() reasons lazily via IsSuperTypeOfResult closures (#6003), [#14918]
  • Memoize the ExprHandler lookup by Expr class in specifyTypesInCondition() and processExprNode() (#5999), [#14919]

Function signature fixes 🤖

  • Add PHP 8.5 partitioned cookie attribute to session_get_cookie_params() and the cookie option shapes (#6004), [#14922], thanks @VincentLanglet and @staabm!

Internals 🔍

Source: README.md, updated 2026-07-05