NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #500 most downloaded on Packagist
A static analysis tool for finding errors in PHP applications
Latest stable
7.13.1
Last release today
20 Nov 2026
Ships unpredictably
gaps range from 8 days to 5 months
Most releases are documented
notes for 49 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
563 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
fix(baseline): merge duplicated files and issue types when reading a baseline by @jirkace in #13098
Full Changelog: 7.0.3...7.0.4
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Fix: issues found while scanning are lost with a warm cache by @alies-dev in #13156
array_first and array_last (PHP 8.5) by @alies-dev in #12157array_find/array_any/array_all callbacks by @alies-dev in #13245array_pop/array_shift by @alies-dev in #13246Full Changelog: 7.0.2...7.0.3
Fix the caller of @internal checks in namespaced functions by @roxblnfk in #13136
Full Changelog: 7.0.1...7.0.2
Report each property write in a restricted purity context once by @danog in #13067
__destruct and other magic methods is reported unused by @alies-dev in #13069__callStatic and the code it uses reported unused by @alies-dev in #13073Full Changelog: 7.0.0...7.0.1
Nothing published for this version
Support conditional taint sinks: @psalm-taint-sink ($mode is 0 ? null : 'html') $content by @danog in #12458
Full Changelog: 7.0.0-rc8...7.0.0-rc9
Let plugins add taint paths: Codebase::getTaintNode(), getTaintPropertyNode(), addTaintPath() by @danog in #12454
Full Changelog: 7.0.0-rc7...7.0.0-rc8
Remove the html taint from json_encode() called with JSON_HEX_TAG and JSON_HEX_AMP by @danog in #12453
Full Changelog: 7.0.0-rc6...7.0.0-rc7
Support the decimal-int-string and non-decimal-int-string types by @danog in #12417
Full Changelog: 7.0.0-rc5...7.0.0-rc6
Support global constant wildcards in types by @danog in #12419
Read the WordPress hash notation after a @return or @var type as a description by @danog in #12416
Let @psalm-flow ($this) -> return carry the taints of the object a method is called on by @danog in #12302
_ purity to the closure parameters a function-like calls with --alter by @danog in #12019Foo::class in constants outside class context by @rela589n in #12364--set-baseline runs with --use-baseline by @alies-dev in #12385is not and nullable/intersection if-branches in conditional types by @danog in #12415self and parent in @param-out against the declaring class by @alies-dev in #12391Note truncated.
Drop the BC baseline entry for an unreleased storage property by @alies-dev in #13000
Time\Duration, SortDirection and poll API classes by @alies-dev in #12953StreamError/StreamException, Uri\* builder, Openssl\*, IntlNumberRangeFormatter and Snmp\* classes and enums by @alies-dev in #12967@template T = Default) by @alies-dev in #12962@template T = Default) by @alies-dev in #12963@method is not resolved by @alies-dev in #12206NAN, INF and out-of-range float literals on PHP 8.5+ by @alies-dev in #12902clamp() from its arguments by @alies-dev in #12950array_multisort() flags when Psalm runs on PHP 8.6 by @alies-dev in #12969new for a template-free constructor argument by @alies-dev in #12993PossiblyInvalidOperand on concat of int operand with null or false by @alies-dev in #13033@template tags with one parser by @alies-dev in #12961ComplexMethod in BinaryOpAnalyzer::analyze() failing self-analysis by @alies-dev in #13015ImmutableDependency on subclasses of Monolog handlers and Reflection classes by @alies-dev in #13047Full Changelog: 7.0.0-rc27...7.0.0-rc28
Narrow a sealed keyed array with keys 0, 1, 2... to a list on array_is_list by @jirkace in #12590
Fix: psalm --init crash on non-existent composer autoload directories by @alies-dev in #12659
#[\DelayedTargetValidation] (PHP 8.5) by @alies-dev in #12282@mixin is ignored for property fetches by @alies-dev in #12289$_SERVER['REQUEST_TIME'] type embeds the current timestamp by @alies-dev in #12551opcache.jit is already off by @alies-dev in #12705Full Changelog: 7.0.0-rc25...7.0.0-rc26
Don't report the deprecated class that uses a trait for the self and static types of its methods by @jirkace in #12712
Full Changelog: 7.0.0-rc24...7.0.0-rc25
Keep builtin methods a preloaded stub leaves out, and make Fiber::getCurrent() pure by @danog in #12660
Full Changelog: 7.0.0-rc23...7.0.0-rc24
[6.x] Fix: false InvalidAttribute for #[\Deprecated] on traits (PHP 8.5) by @alies-dev in #12277
#[\Deprecated] on traits (PHP 8.5) by @alies-dev in #12277RedundantConditionGivenDocblockType for @Property on a nullable object by @alies-dev in #12640Full Changelog: 7.0.0-rc22...7.0.0-rc23
Fix taint analysis running out of memory on arrays checked with isset() early by @alies-dev in #12583
isset() early by @alies-dev in #12583Full Changelog: 7.0.0-rc21...7.0.0-rc22
One-line actionable CLI messages by @alies-dev in #12566
Full Changelog: 7.0.0-rc20...7.0.0-rc21
Require psalm/plugin-laravel 4.x, the line built for Psalm 7.x by @alies-dev in #12570
Full Changelog: 7.0.0-rc19...7.0.0-rc20
Support generic exception classes in @throws by @orcnd in #12090
parent:: first-class callables of @method pseudo-methods by @alies-dev in #12148Full Changelog: 7.0.0-rc1...7.0.0-rc2
Require the psalm/* plugins and enable them, and the webmozart/assert plugin, for the libraries a project uses by @danog in #12568
Full Changelog: 7.0.0-rc18...7.0.0-rc19
Name the parameters the conditional return types of the webmozart/assert all* stubs check by @danog in #12567
Full Changelog: 7.0.0-rc17...7.0.0-rc18
[7.x] Perf: don't deep-scan Composer's autoloader machinery by @alies-dev in #12556
O(N²) -> O(N)) by @alies-dev in #12559Full Changelog: 7.0.0-rc16...7.0.0-rc17
Return the list or array the webmozart/assert all* assertions are given by @danog in #12541
Full Changelog: 7.0.0-rc15...7.0.0-rc16
Resolve ArrayAccess offset types in isset()/empty(), don't report risky truthiness of mixed unions by @danog in #12540
Full Changelog: 7.0.0-rc14...7.0.0-rc15
Add a stub for the zstd extension by @danog in #12539
Let plugins give an expression the taint nodes of a list, without their internal ids by @danog in #12535
Full Changelog: 7.0.0-rc12...7.0.0-rc13
Analyse traits declared inside a namespace by @ybai08 in #12498
Full Changelog: 7.0.0-rc11...7.0.0-rc12
Taint flows into and out of $this properties matched by array key by @danog in #12476
Full Changelog: 7.0.0-rc10...7.0.0-rc11
Add the file sinks of php-vips sources, targets and findLoad() to its stub by @danog in #12478
Full Changelog: 7.0.0-rc9...7.0.0-rc10
Taint what functions and builtins leave in by-reference parameters by @danog in #12095
Full Changelog: 7.0.0-beta24...7.0.0-rc1
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Purity and taint fixes: getters, explicit/overridden annotations, defaults, void templates, ext stubs, socket builtins by @danog in #12073
Full Changelog: 7.0.0-beta23...7.0.0-beta24
Report string increments as deprecated since PHP 8.5, suggest str_increment() by @danog in #11993
@self-out / @this-out by @alies-dev in #11964@param-closure-this docblock tag by @alies-dev in #11853#[\Override] on properties (PHP 8.5) by @alies-dev in #11891IdeDetector, auto-detect IDE when none specified by @alies-dev in #11802--init-ci command to generate GitHub Actions workflow by @alies-dev in #11748extraFiles also for language server by @susnux in #11919clone() withProperties keys by @alies-dev in #11999_ purity of closure types as a class name by @danog in #12014$class::$prop reads and assignments when the class is a variable by @HenkPoley in #12040new $c checks when the class string has a leading backslash by @HenkPoley in #12039_ purity by @danog in #12043TypeParseTreeException for an incomplete conditional type by @alies-dev in #11962TKeyedArray::make() factory to 6.x for cross-version plugin compatibility by @alies-dev in #11810Full Changelog: 7.0.0-beta22...7.0.0-beta23
[6.x] Support the PHP 8.5 #[\NoDiscard] attribute by @alies-dev in #11892
#[\NoDiscard] attribute by @alies-dev in #11892trace key to error_get_last() by @janedbal in #11975self in @property type tokens at scan time by @alies-dev in #11846Full Changelog: 7.0.0-beta21...7.0.0-beta22
Restore custom taint map from cache; make taint analysis deterministic by @danog in #11946
Full Changelog: 7.0.0-beta20...7.0.0-beta21
Rewrite dead-code detection on a code-use graph and infer purity across the call graph. Unused-code detection now runs on a directed graph of referenc
Psalm\Internal\Codebase\CodeUseGraph), in the same way as taint analysis:MissingPureAnnotation (and its --alter--find-unused-psalm-suppress now also reports redundant @psalm-suppress on--taint-analysis, on Tainted* issues.@api. @danog in #11939IncompatibleTypeParameters issue (level 1),echo/print/exit taint sinks not matching their argument nodes (which brokeTaintedHtml detection through those constructs), fix taint tracking throughDataFlowNode factories$this failing to parse inside generic type parameterscovariant/contravariant variance modifiers in generic typeUndefinedDocblockClass (backport)TLiteralFloat now renders NAN values as float(NAN) in--find-unused-psalm-suppress checking in docs/running_psalm/configuration.md,docs/annotating_code/supported_annotations.md,docs/running_psalm/issues/MissingPureAnnotation.md anddocs/running_psalm/issues/UnusedPsalmSuppress.md, and update the CLI helpdocs/annotating_code/type_variables.md and the IncompatibleTypeParametersDataFlowNode factories: mandatory $storage, typed callable kinds,ScopeAnalyzergetArgs() callsOverride in the SuicidalAutoloader fixture and dropimpure- Closure prefix in TypeParseTestsebastian/diff 9Full Changelog: 7.0.0-beta19...7.0.0-beta20
Nothing published for this version
Final improvements for reduced scanning by @danog in #11809
Full Changelog: 7.0.0-beta18...7.0.0-beta19
Introduce psalm plugin API by @danog in #11739
compact output format to table, add new truly compact format by @alies-dev in #11750TaintedLlmPrompt issue type for prompt injection detection by @alies-dev in #11746ERROR_LEVEL for plugin-defined issues by @alies-dev in #11736PHPSTORM env var on Darwin by @alies-dev in #11801Full Changelog: 7.0.0-beta17...7.0.0-beta18
Add stub for memcached by @ADmad in #11717
Full Changelog: 7.0.0-beta16...7.0.0-beta17
This release allows using @psalm-pure on classes, which will mark all methods as pure, and ban property declarations.
This release allows using @psalm-pure on classes, which will mark all methods as pure, and ban property declarations.
Full Changelog: 7.0.0-beta15...7.0.0-beta16
This release features a major refactoring of Psalm's mutability inference system.
This release features a major refactoring of Psalm's mutability inference system.
This release will likely be followed by a stable release.
The new automated mutability (pure, mutation free, externally mutation free, impure) attribute fixes that will be proposed by Psalm, when applied, will improve Psalm's type inference and especially security analysis, as pure functions are automatically specialized by Psalm, killing false positives during security analysis.
Now, Psalm will always analyze and emit MissingPureAnnotation and MissingImmutableAnnotation issues for all functions, methods and classes that can be marked with one of the following attributes (which can be automatically added by running Psalm with --alter --issues=MissingPureAnnotation,MissingImmutableAnnotation).
For functions and methods, MissingPureAnnotation will be emitted, automatically adding the following annotations:
@psalm-pure » - Indicates that the function or method is pure, one whose output is just a function of its input (no mutations or even read property accesses allowed).@psalm-mutation-free » - Used to annotate a class method that does not mutate state, either internally or externally of the class's scope (only internal property reads on $this are allowed for methods)@psalm-external-mutation-free » - Used to annotate a class method that does not mutate state externally of the class's scope (internal property reads and writes on $this and self are allowed for methods)@psalm-impure » - A new annotation, equivalent to the default mutability level of functions and methods (all mutations allowed): Psalm will require the explicit annotation of only abstract methods with this or any of the above annotations through a separate, non-autofixable MissingAbstractPureAnnotation issue, to improve mutability inference for implementors of an interface (though it can be used on all functions and methods as well).For classes, MissingImmutableAnnotation will be emitted, automatically adding the following annotations:
@psalm-immutable » - Used to annotate a class where every property is treated by consumers as @psalm-readonly and every instance method is treated as @psalm-mutation-free.@psalm-external-mutation-free » - Used to annotate a class where every instance method is treated as @psalm-external-mutation-free.@psalm-mutable » - A new annotation, used to annotate a class where at least one property is mutable: this is the default behavior, but it can be explicitly marked for clarity: Psalm will require the explicit annotation of only interfaces with this or any of the above annotations through a separate, non-autofixable MissingInterfaceImmutableAnnotation issue, to improve mutability inference for implementors of an interface (though it can be used on all classes and interfaces as well).For situations where the callable or Closure needs to be pure, mutation-free or externally mutation-free, the following subtypes are available:
@psalm-pure
pure-callablepure-Closure$this are allowed for methods), equivalent to marking functions or methods with @psalm-mutation-free
self-accessing-callableself-accessing-Closure$this and self are allowed for methods), equivalent to marking functions or methods with @psalm-external-mutation-free
self-mutating-callableself-mutating-Closure@psalm-impure
impure-callable (an alias to callable)impure-Closure (an alias to Closure)This can be useful when the callable is used in a function marked with @psalm-pure or @psalm-mutation-free or @psalm-external-mutation-free.
Full Changelog: 6.15.1...7.0.0-beta15
More detailed progress for taint graph resolution by @danog in #11349
--config= cli parameter by @ThomasLandauer in #11332Full Changelog: 6.14.3...7.0.0-beta14
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add support for reading inheritors from a phpstan-sealed tag by @stof in #11818
curl_share_setopt, imap_timeout, imap_expunge by @ThomasLandauer in #11858Full Changelog: 6.20.13...6.21.0
Fix alter ignoring MissingThrowsDocblock suppression by @d-mitrofanov-v in #11586
Full Changelog: 6.20.12...6.20.13
[6.x] Fix crash when a class extends a class_alias() declared later by @wleeaf in #12494
One column per quarter.