An Oracle blog about NetBeans for PHP

Marking occurrences improved

Mark occurrences is not a new feature, but the trunk contains some improvements in this area. In the source the feature highlights in the elements which is under the cursor position. You can also easily move between marked occurrences through ALT + UP and ALT + DOWN shortcuts.

I'm going to show you some differences. On the pictures there is on the left side screenshot of NetBeans 6.5 and on the right side screenshot of the same source, but from NetBeans 7.0 development build.

Class fields are also marked in the PHP doc.

Parameters of a function or a method are also marked in the PHP doc.

Types are marked in the PHP doc as well.

NetBeans are now able to mark the same methods in  method chains.

Join the discussion

Comments ( 11 )
  • Stefan Sturm Thursday, December 18, 2008


    I use this comment to post a feature request :-)

    I think a lot of developers are using foreach to iterate over arrays containing objects. So, I'm missing CodeCompletion inside this Foreach...

    So I have some code to show a possible solution:

    class Person


    public $id;

    public $name;


    \* @return array of Person


    public static function loadList()


    return $list;



    $list = Peron::loadList();

    foreach( $list as $l_value )


    echo $l_value->name // Here I would like to have CodeCompletion...


    Perhaps it is possile to the DocBlock @return with "array of object" to know that the variable contains an array of objects, so it can be used in a foreach to show CodeCompletion.

    What do you say? Is it possible?

    Thanks for your time,

    Stefan Sturm

  • Michal Thursday, December 18, 2008

    Another possibility is to implement variable type hinting (@var):

    foreach( $list as $l_value )


    /\* @var $l_value Person \*/

    echo $l_value->name // Here I would like to have CodeCompletion...


    There's bug already filled for it:


  • Stefan Sturm Thursday, December 18, 2008


    I voted for this bug( feature ). I hope it will be fixed( added ) asap...


  • Petr Thursday, December 18, 2008

    Hi Stefan and Michael,

    I and Radek we are currently working on the mentioned issue. I think that the bulk of the work is already done and it will be available in the trunk soon.



  • Stefan Sturm Thursday, December 18, 2008


    Great to hear :-)


  • N, Varun Thursday, December 18, 2008

    You guys are rocking! Cheers ;)

  • soso Monday, December 22, 2008

    Hi Petr,

    Is there a simple way to upgrade between dev/nightly releases? I see that each installer installs in a separate folder and I have to import again the projects and to the ide settings all over again.



  • Petr Monday, December 22, 2008

    To Soso:

    I use the dev builds as well, but I don't use installers. I always use the OS independent zip files. So download the zip file, delete the old version or unzip it in a different folder and run the new version with the same userdir (--userdir switch - http://blogs.sun.com/netbeansphp/entry/userdir ).



  • soso Monday, December 22, 2008

    Got it!

    Thanks Petr!

  • Robert A. Henru Tuesday, February 10, 2009

    Hi, I've been using Netbeans 6.5 and run the latest update, but I can't see this feature yet. What should I do to download/install/use this feature (or any that is mentioned in this blog)?



  • tiffany and co Friday, November 13, 2009

    Hi, I've been using Netbeans 6.5 and run the latest update

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.