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.
Created attachment 152991 [details] the prompt screeshot I use try {} catch{},code like follow: public function test() { try { $sk = 'knight'; $this->testexp(); } catch (Exception $exc) { echo $exc->getMessage() . '<br>'; echo $sk; } } I define $sk at try {}, and use it at catch{}, but the IDE prompt me that $sk seems to be uninitialized.
Well, this seems to be correct because e.g. in Java, this would be an error. You would need to type something like this: $sk = null; try { $sk = 'knight'; $this->testexp(); } catch (Exception $exc) { echo $exc->getMessage() . '<br>'; echo $sk; } But this is not necessary in PHP so there should not be any warning here. Thanks for reporting.