Last Updated: February 25, 2016
·
2.17K
· mauris

Define variable typing in NetBeans IDE

To define the variable type for a PHP variable for sake of auto-completion in NetBeans IDE, simply type the shortcut

vdoc

and press Tab. This will generate a comment that looks like this:

/* @var $variable Example */

After that line in the same variable scope, you will be able to see auto-complete for methods and properties of Example class when you type:

$variable->

This type-hinting is namespace friendly in PHP 5.3 and 5.4. I work mainly with PHP 5.3.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside