phpinspectionsea
phpinspectionsea copied to clipboard
[FN]: $variable seems to not be defined in scope.
Subject | Details |
---|---|
Plugin | com.kalessil.phpStorm.phpInspectionsEA (5.0.0.0) |
Language level | PHP 8.0 |
Current behaviour
function hi($in): mixed {
$x = $good ?? [];
$x2 = [$bad1] ?? [];
$x3 = hi([$bad2]) ?? [];
$x4 = hi([$bad3]) ?? '';
return $_REQUEST['a'];
}
Expected behaviour
It correctly handles $good
by highlighting it as a probable issue.
However, when the undefined variable is tucked within an array, it doesn't seem to care?
Every $bad#
variable should be highlighted.
Environment details
PhpStorm 2023.1.3 Build #PS-231.9161.47, built on June 21, 2023 Runtime version: 17.0.7+10-b829.16 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.19.0-46-generic