The Little Guy Posted June 30, 2012 Share Posted June 30, 2012 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? Quote Link to comment https://forums.phpfreaks.com/topic/265054-netbeans-variable-seems-to-be-uninitialized/ Share on other sites More sharing options...
Philip Posted June 30, 2012 Share Posted June 30, 2012 I haven't seen an option for that, just to turn it off/on and what it should show as (warning, error, etc.). Would be nice, but I don't think there is one? Quote Link to comment https://forums.phpfreaks.com/topic/265054-netbeans-variable-seems-to-be-uninitialized/#findComment-1358195 Share on other sites More sharing options...
The Little Guy Posted June 30, 2012 Author Share Posted June 30, 2012 Its weird, because when I type type it, Auto Complete even knows what file it is initiated in, but the editor doesn't... Quote Link to comment https://forums.phpfreaks.com/topic/265054-netbeans-variable-seems-to-be-uninitialized/#findComment-1358199 Share on other sites More sharing options...
xyph Posted July 1, 2012 Share Posted July 1, 2012 That's really odd. I've never see that. Both files are in the same project? Quote Link to comment https://forums.phpfreaks.com/topic/265054-netbeans-variable-seems-to-be-uninitialized/#findComment-1358256 Share on other sites More sharing options...
The Little Guy Posted July 1, 2012 Author Share Posted July 1, 2012 That's really odd. I've never see that. Both files are in the same project? Yeah, they are both in the same project, but different locations, not sure if that matters: /index.php /includes/setup.php Quote Link to comment https://forums.phpfreaks.com/topic/265054-netbeans-variable-seems-to-be-uninitialized/#findComment-1358319 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.