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 247339 - Wrong hint 'unitialized variable'
Summary: Wrong hint 'unitialized variable'
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-21 13:59 UTC by projekter
Modified: 2016-08-29 06:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description projekter 2014-09-21 13:59:15 UTC
Netbeans shows a strange behavior with the 'uninitialized variable' hint:

/*public static*/ function registerShutdownFunction($callable) {
   while(isset(self::$shutdownFunctions[$id = uniqid()]));
   self::$shutdownFunctions[$id] = $callable;
   return $id;
}

The variable $id is definitely assigned after the while statement. So in the nextline, Netbeans does not show any hint regarding this variable (correct). But in the return line, $id is reported as possible uninitialized.
This behaviour only occurs when the three lines are wrapped in a function (normal or class method) but not when used in global scope.