vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

For loop, undefined variable in third expression

Open momala454 opened this issue 3 years ago • 1 comments

Describe the bug An undefined variable in third expression, when the variable is created in the for loop, is shown as an error

To Reproduce

(function () {
    for ($i = 10; $i > 0; $i-= $o)
    {
        $o = 1;
    }
})();

Take note that if I put the for outside a function, no error is shown

Expected behavior No error

Screenshots image

Platform and version windows 10 intelephense 1.8.0

momala454 avatar Feb 03 '22 13:02 momala454

Workaround for now is to declare it beforehand for ($i = 10, $o = 0; $i > 0; $i-= $o)

bmewburn avatar Dec 28 '22 21:12 bmewburn