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

Summary: Wrong hint 'unitialized variable'
Product: php Reporter: projekter
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.1   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

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.