Jump to content

Netbeans "variable seems to be uninitialized"


Recommended Posts

In my Netbeans editor, I get this warning, when using a variable that is defined in an included file:

Variable $name seems to be uninitialized

 

Anyone know how to make Netbeans see that it is in fact initiated in the file that is being included?

 

config.php

<?php
$temp = new Template();

 

index.php

<?php
/** 
* @var $temp Template
*/
require_once "config.php";
$temp->display("index.tpl");

 

In my above example, in index.php $temp says Variable $temp seems to be uninitialized and yet it is but in the included file. adding the @var turns on auto complete, in the file for $temp, but the variable still shows it is uninitialized.

 

So, Anyone know how to turn it on in Netbeans?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.