Major new feature 🚀
Dependent variables
PHPStan can now understand relationships between different variables. Cases like these are now understood correctly:
if ($debug) {
$foo = 'bar';
}
if ($debug) {
// previously: Variable $foo might not be defined.
// now: no error
echo $foo;
}
Additionally, this feature fixes all these issues: #801, #806, #1209, #1306, #1722, #1865, #2980, #3371, #3986
Bugfixes 🐛
- Implement property name as an expression in
TypesAssignedToPropertiesRule
(https://github.com/phpstan/phpstan-src/commit/7458d1e09c00a70ce00453db07f4e2412db599f3)
- Updated
nikic/php-parser
(https://github.com/phpstan/phpstan-src/commit/19bf582aa3c0e0809446a17399d17d17ab40297c), #4194
Function signature fixes 🤖
- Changing return type of
Collator::compare
toint|false
(#410), thanks @vasekbrychta!
- Update PHP 8 stubs (https://github.com/phpstan/phpstan-src/commit/44305499fe9b4aca8943c8e15382581372f6bd45), #4268