-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
Summary of a problem or a feature request
In the below example the two conditionals both evaluate to true based on the same variable. If the variable is true the code within each block should be evaluated and $foo should therefore be defined in the second block, but Phpstan reports that it might be undefined
------ -------------------------------------
Line analyzed.php
------ -------------------------------------
4 ...
10 ...
11 Variable $foo might not be defined.
------ -------------------------------------
Code snippet that reproduces the problem
<?php
$baz = true; // ignore: could be false|true at runtime
if ($baz) {
$foo = 'asd';
}
if ($baz) {
$bar = $foo;
}Reactions are currently unavailable