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.
User.php <?php class User { /** * @var int $id */ public $id; /** * * @var string */ public $login; public function __construct (stdClass $a){ foreach($a as $k=>$v){ $this -> $k = $v; } } } ?> index.php <?php include 'User.php'; $a = new User(new stdClass()); $a-> ?> Expected: int id string login Actual: int id ? k string login When I add source of index.php to user.php works well
There are two problems. 1) When User.php file is added, the index doesn't scan method. When you switch to another file, then the lazy indexing scan methods as well, so offers also the property, that are "defined" in methods. 2) The dolared properties shouldn't be considered as fields. The second problem will be easy to fix. The first issue with different content of index during editing file is really problem. If we will remove the lazy scanning, then we downgrade performance of editing, which will be very visible for bigger files.
Works for me properly in 7.2 dev. No $k property. Product Version: NetBeans IDE Dev (Build 20120413-edba28b83bfc) Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02 System: Linux version 3.0.0-17-generic-pae running on i386; UTF-8; cs_CZ (nb) User directory: /home/warden/userdir Cache directory: /home/warden/userdir/var/cache