This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 217714

Summary: Variables that "seem to be unused in its scope" are used in included files
Product: php Reporter: regex
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal CC: mesuut
Priority: P4    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description regex 2012-09-02 21:53:59 UTC
$flag = TRUE; // this variable is hinted as unused
$prefix = 'sushi_'; // this variable is also hinted as unused

require './makepage.php'; 

---

/** makepage.php **/

if($flag) { /* stuff */ }
$dish = $prefix.$name;

It would be awesome if the Hint could catch that---there would be a lot fewer "false hints", which would make the hint more useful. As it is, the hints can be so many that I don't look at them anymore.

One way to implement might be to add a flag in Options / Editor / Hints / Unused Variables to "Check Included Files".

Thanks team, wishing you a beautiful week.
Comment 1 Ondrej Brejla 2012-09-03 07:36:41 UTC
That hint is handled just in one file...this "global" crappy stuff is not supported intentionally. It's not easily feasible, so P4 for me as a reminder. Thanks!
Comment 2 amobilia 2016-09-22 18:00:35 UTC
*** Bug 228677 has been marked as a duplicate of this bug. ***