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.
class blah { static private $instance = null; public static function getInstance() { if ( self::$instance === null ) { self::$instance = new self; } return self::$instance; } } it doesnt understand that new self creates an object of the same type as the object that it is called from.
I cannot see any problem with how NB handles specified code. Are you getting unexpected code completion results, error message, ... ? Please describe what you mean by "it doesnt understand" and reopen the issue
I see the following problems here: 1) self::$instance = new se| can't be completed by CC. 2) self::$instance = new self code causes "Class not found" warning (it the warning is turned on). 3) in code like the following class MyClass{ public $testfield; public static function myfunc(){ $obj=new self; echo $obj->|; } } CC says "No suggestions", 4) in the previous example, if I type echo $obj->testfield manually, the IDE gives warning that $obj is unused.
*** This issue has been marked as a duplicate of 163269 ***