| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| phpstan.phar | 2026-06-05 | 27.1 MB | |
| phpstan.phar.asc | 2026-06-05 | 833 Bytes | |
| 2.2.2 source code.tar.gz | 2026-06-05 | 4.0 MB | |
| 2.2.2 source code.zip | 2026-06-05 | 4.0 MB | |
| README.md | 2026-06-05 | 4.5 kB | |
| Totals: 5 Items | 35.1 MB | 1 | |
Improvements 🔧
- Narrow
preg_match/preg_match_allsubject string type when match is truthy (#5777), [#14710], thanks @staabm and @VincentLanglet! - Resolve per-element callback return types in array_map for closure and arrow function callbacks (#5716), [#14649], [#11656], thanks @VincentLanglet and @staabm!
- Support union types in str_repeat() (#5784), thanks @staabm!
- Report impossible class_exists/interface_exists/trait_exists/enum_exists (#5754), [#14683], thanks @janedbal!
- Narrow variadic parameter array key integer type to
int<0, max>(#5791), [#14744], thanks @staabm and @VincentLanglet! - Build an (unsealed) array shape in ArrayType::intersectKeyArray() when the other operand has known sealedness (#5792), [#14747]
- Resolve
WithoutImpurePointspurity transitively through calls to other effect-free callables (#5798), [#14759] - ctype_digit() narrows to decimal-int-string (#5311), thanks @staabm!
- Infer
decimal-int-string/non-decimal-int-stringfor regex capturing groups matching (non-)digits (#5793), [#14750], thanks @staabm, @VincentLanglet and @mvorisek! - Infer
decimal-int-stringwhen castingint/int<a, b>tostring(#5794), [#14753], thanks @staabm and @VincentLanglet!
Bugfixes 🐛
- Create cross-kind conditional expression holders in
BooleanAnd/BooleanOrtype specifier with truthy fallback forisset()(#5760), [#10644], [#11918], [#3385], [#6202], [#14455], thanks @VincentLanglet and @staabm! - Fix file path of trait errors reported directly in the trait (#5780), [#14718], thanks @janedbal!
- PHPStan should not crash on startup when projects' composer.json is invalid (#5779), [#14724], thanks @staabm!
- Narrow array key type when removing
HasOffsetTypeviaArrayType::tryRemove(#5756), [#9461], thanks @VincentLanglet and @staabm! - Narrow value type instead of unsetting key in
ConstantArrayType::tryRemoveforHasOffsetValueType(#5776), [#14711], thanks @VincentLanglet and @staabm! - Allow reinitialization of a readonly property in __clone since PHP8.3 (#5731), [#11495], thanks @grizzm0!
- Omit key type from unsealed ConstantArrayType description when the unsealed extra type is
array-key(https://github.com/phpstan/phpstan-src/commit/49074ec999435f8676e21ba8fb2511e8b0180a64), [#14732] - Revert "Return
list<mixed>fromPDOStatement::fetchAll()(#5643)" (#5795), thanks @staabm! - Treat declarations with a non-void
@throwsas not effect-free in theCallTo*StatementWithoutImpurePointsRulefamily (#5802), [#14767]
Function signature fixes 🤖
- Correct xdebug filename/trace function return types in functionMap to include
false/null(#5788), [#14736]
Internals 🔍
- Cleanup
instanceof ConstantStringType(#5783), thanks @staabm! - Cleanup
instanceof ConstantScalarType(#5785), thanks @staabm! - Simplify use of
getConstantScalarTypes()togetConstantScalarValues()(#5786), thanks @staabm! - PHPBench: use custom report format (#5789), thanks @staabm!
- Add missing
return(https://github.com/phpstan/phpstan-src/commit/1643f147d54469b61321fdb4d84a4a9e4354641d) - Add regression test (#5797), [#14758], thanks @staabm!