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.43
Name Modified Size InfoDownloads / Week
Parent folder
phpstan.phar 2026-03-24 26.3 MB
phpstan.phar.asc 2026-03-24 833 Bytes
2.1.43 source code.tar.gz 2026-03-24 3.9 MB
2.1.43 source code.zip 2026-03-24 3.9 MB
README.md 2026-03-24 6.7 kB
Totals: 5 Items   34.0 MB 0

Another week, 37 issues crushed!

Improvements 🔧

  • Call operator type specifying extensions for bitwise and arithmetic operators (#5226), thanks @Firehed!
  • Introduce UnaryOperatorTypeSpecifyingExtension interface (#5284), thanks @Firehed!
  • Report trait.duplicateMethod (#5181), [#14250], thanks @VincentLanglet and @staabm!
  • Cannot re-assign superglobal variable in parameters (#5153), [#14241], thanks @VincentLanglet and @staabm!
  • Prevent PHP error "Fatal error: Cannot re-assign $this" with a new rule (#5276), [#14349]
  • Implement more missing errors arround use of $this (#5278), [#14351], thanks @staabm!
  • Infer non-empty-list/array after isset($arr[$i]) (#4441), [#13674], [#12482], [#13675], thanks @staabm!
  • Support call_user_func_array (#5286), [#5942], [#5934], thanks @VincentLanglet!

Bugfixes 🐛

  • Fix: Offset 0 should not be optional on non empty list (#5236), [#14308], thanks @VincentLanglet and @staabm!
  • Narrow DOMDocument::createElement() return type and throw type for valid constant names (#5192), [#13792], thanks @janedbal!
  • Fix: Parameter #2 of array_key_exists expects array, non-empty-array given (#5237), [#14312], thanks @staabm and @VincentLanglet!
  • Fix: Failed Determine type in match operator (#5066), [#9601], thanks @VincentLanglet and @staabm!
  • Fix: Throw point are not properly recognized (#5166), [#9349], thanks @VincentLanglet and @staabm!
  • Fix: Anonymous class causes "variable might not be defined" issue (#5205), [#13920], thanks @VincentLanglet and @staabm!
  • Fix: False positive variable might not be defined (#5240), [#14318], thanks @VincentLanglet and @staabm!
  • Fix: "Cannot use [] for reading." false positives (#5059), [#5290], thanks @VincentLanglet and @staabm!
  • Fix: Weird variable might not be defined behavior (#5245), [#14323], thanks @VincentLanglet and @staabm!
  • Fix: Foreach on constant array with closures reaching 32 entries causes crash (#5246), [#14324], thanks @staabm and @VincentLanglet!
  • Fix fatal error when path has array value in ignoreErrors (#5183), [#14231], thanks @janedbal!
  • Fix: Unreachable statement information gets lost (#5253), [#14328], thanks @VincentLanglet and @staabm!
  • Fix: Variable passed by reference are not updated (#5217), [#14275], [#8056], thanks @VincentLanglet and @staabm!
  • Fix incorrect narrowing of nested array after assignment (#5258), [#13857], [#10089], thanks @staabm!
  • Fix: incorrect type-narrowing to *NEVER* inside array row (#5263), [#13786], thanks @staabm and @VincentLanglet!
  • array_column should not extract non-public properties from objects (#5210), [#13573], thanks @janedbal!
  • Fix "Parameter X of array_values is already a list, call has no effect"-false positive (#5271), [#13629], thanks @staabm!
  • Fix: strange behavior on regex capture groups (#5239), [#14314], thanks @VincentLanglet!
  • Fix: Enum case outside of enum should be reported (#5188), [#14252], thanks @staabm and @VincentLanglet!
  • Fix identifier being red (https://github.com/phpstan/phpstan-src/commit/7859ab8b44a917dc834f06886399f25574900034)
  • Fix: TemplateIntersectionType is lost inside TypeCombinator::intersect (#5275), [#14348], [#9961], [#13577], thanks @staabm and @VincentLanglet!
  • Fix: Setting an array key doesn't update a reference (#5257), [#14333], thanks @VincentLanglet and @staabm!
  • Fix infinite loop in recursive generics (#5288), [#13801], thanks @staabm!

Performance 🏎️

  • IntersectionType: Prevent duplicate work in isOffsetAccessible() (#5243), [#14319], thanks @staabm!
  • Fix: PHPStan takes extremely long analyzing if-offset checks on array|object (#5242), [#14319], thanks @staabm and @VincentLanglet!

Function signature fixes 🤖

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

Internals 🔍

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