Cast variable to enable autocomplete in NetBeans

Hello, this post is for my own reminder - I bet that in a week I forgot it ;)
I hope someone will find it helpfull too.

One of the most importand tool in any IDE is autocomplete.
You don't need to look in documentation to find method what you are exactly looking for. With autocomplete its extremely faster - well we all knew that.

But the problem in NetBeans comes when you get variable from some method and this variable starts to represent object. Like in this example:
$doc = new DOMDocument();
$form = $doc->getElementsById("myform");
$attr = $form->
So now you want do the magic with new DOMElement object inside $form variable.
You type $form->, hit Ctrl+Space... and NetBeans says 'No suggestions' - what a pity.