PHPStan `param-closure-this` reassigns `self` (regression)
Author: dantleechCreated Sep 8, 2026Updated Sep 29, 2026
Labelsbug
Bug report
PHPStan seems to incorrectly assigns the type of param-closure-this to self:: after upgrading from 2.1.43 to 2.2.13:
Code snippet that reproduces the problem
https://phpstan.org/r/bb5c30c4-28b9-417a-8396-be2154fbcff3
Expected output
param-closure-this should probably only assign $this and not self as self:: resolves as expected at runtime.
Did PHPStan help you today? Did it make you happy in any way?
Yes! It's almost 2x as fast without the turbo extension.
Source: phpstan/phpstan