You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix false positive on shadowed variable lint due to lambdas
Summary:
The shadowed variable lint is intended to warn users when they're unexpectedly overwriting a local variable by their `foreach` or `catch` block.
```
function demo(): void {
$x = 99;
foreach (vec[1, 2] as $x) {
}
$x; // 2 here
}
```
However, we previously ignored that lambdas introduce a new scope. Ensure that we track local variables inside lambdas separately.
Closes#8986
Reviewed By: mpu
Differential Revision: D39003052
fbshipit-source-id: 6d6c0cf32dcea57bb0e7437e396631a00df7975f
0 commit comments