pdt icon indicating copy to clipboard operation
pdt copied to clipboard

Referenced variable is falsely marked as never used

Open flack opened this issue 2 years ago • 3 comments

Describe the bug

A referenced variable in a foreach loop is falsely marked as never used:

Screenshot_20230522_151645

It is a false positive, because $array after the loop has the values [2, 4].

Describe the eclipse environment

Eclipse 23.03 PDT 8.0.0.202305201924

Describe your system

  • OS: Ubuntu
  • Version 23.04

To Reproduce

See screenshot above

Expected behavior There should not be a warning

flack avatar May 22 '23 13:05 flack

another example of the same issue:

Screenshot_20230522_154031

flack avatar May 22 '23 13:05 flack

This is an issue in the PHP 7 tooling also.

Eclipse IDE for PHP Developers (includes Incubating components)

Version: 2023-03 (4.27.0) Build id: 20230309-1520

PHP Development Tools (PDT) 7.2.1.202112011741

nunnrlc avatar May 24 '23 10:05 nunnrlc

Similar issue #87

zulus avatar May 24 '23 10:05 zulus