php include() question, variable & function autocompletion
I am the beginner of PHP, while i am using INCLUDE() in PHPSTOREM, i found a question,
for example,
I create a file "abc.php", and inside it , there is " $abc = 10; function abcFunction(){};"
and in the "123.php", i include "abc.php" into it ,
i can get the abcFunction() from the auto completion, but $abc does not,
does there is anyone can tell me which part i have made a mistake
thanks :)
Please sign in to leave a comment.
That is common in IDE's.
If varibles were included in the code completion it would be an awful big mess of options to choose.
Consider working on a big application like WordPress or a framework like CodeIgniter where there are a huge amount of varibles.
But now if it is something that is important that will be re-used throughout the app, then it should be a property or object.
Then it will show under the code completion.
icnlude file
test file
Should out put
10
Bar
Hello jacky,
It is possible to obtain 'global variants' in completion also:
At this point invoke completion manually('ctrl'+'space' is default shortcut for Windows\Linux):
Thank you for feedback!
Jeff,
Thanks for the help!