Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7830095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:04:11+00:00 2026-06-02T11:04:11+00:00

I have a file named config.php, and i have other files includes config.php. When

  • 0

I have a file named config.php, and i have other files includes config.php. When editing one of files, I use an object from config.php and it autocompletes name of the object. But, when i try to see functions or variables of this object (with ->), there is no auto-completion. Is there any way to make it work?

Note: I already added /* @var $myObject myType */ to config.php before the object definition. Do I have to add that line to my every file includes config.php? That doesn’t seem right.

Edit: Sample added.

Directory;

  • config.php
  • index.php
  • lib/test.class.php

config.php;

<?php
define('ABSPATH', dirname(__FILE__));
include_once ABSPATH.'/lib/test.class.php';

/* @var $TestObj test */
$TestObj = new test();

// auto complete works here.
$TestObj->someFunction();
?>

index.php;

<?php
include_once 'config.php';

// here, auto completes object name
// not lists functions or variables after ->
$TestObj->someFunction();
?>

lib/test.class.php;

<?php
class test {
    public $var1;

    public function someFunction() {
        echo 'I am some function.';
        return 0;
    }
}
?>

It is working when i add /* @var $TestObj test */ to index.php but I will have a lot of files like that and there must be a better way than adding that line to all of files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:04:12+00:00Added an answer on June 2, 2026 at 11:04 am

    Make shure that all files of your project are in the project’s include path (righ click project -> properties -> include path). Usually there is only the “global include path”, which you configure in the NetBeans settings (e.g. to point to your PEAR directory). Add all directories which contain source code you want auto completion for to this include path. Hint: This include path has nothing to do with the include_path used in PHP itself.

    Also instead of using hints in the cient code:

    /* @var $TestObj test */
    $TestObj->...
    

    You should give the sources some more apidoc, e.g.:

    <?php
    class test {
        /**
         * @var SomeClass
         */
        public $var1;
    
        /**
         * @return int
         */
        public function someFunction() {
            echo 'I am some function.';
            return 0;
        }
    }
    

    because of the dynamic nature of PHP the IDE realies on this information to give right hints.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following in my config.php file for one of my web app. //db
I have the following .gitignore file # file named .gitignore system/application/config/database.php system/application/config/config.php system/logs modules/recaptcha/config/*
I have a php file named config.php in which I defined the application settings
I have a config file, named config.txt, look like this. IP=192.168.1.145 PORT=10022 URL=http://www.stackoverflow.com I
I have the following config file for solr: <requestHandler name=/update/extract startup=lazy class=solr.extraction.ExtractingRequestHandler > <lst
I have a file named file with three lines: line one line two line
I have following, very simple, XML config for PHPUnit: <phpunit bootstrap=/_tests/TestAutoload.php> <testsuites> <testsuite name=Unit
I have a program that I use on several sites. It uses require('config.php'); to
In my CI system\libraries directory I have a new class named DD_Controller.php. This file
I have a file named my file.pdf and I can't delete this file with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.