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?

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.