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
(phpstan/phpstan-src@7458d1e) - Updated
nikic/php-parser
(phpstan/phpstan-src@19bf582), #4194
Function signature fixes 🤖
- Changing return type of
Collator::compare
toint|false
(#410), thanks @vasekbrychta! - Update PHP 8 stubs (phpstan/phpstan-src@4430549), #4268