Reputation: 1938
This question is different from: Find declaration of a global variable in PHP as that question is asked specifically for Linux as the questioner has mentioned the use of grep, etc.
Actually, I want to contribute to phpMyAdmin. The code has many Global variables and I want to find where they were declared. I am using Windows.
Upvotes: 0
Views: 238
Reputation: 754
There doesn't need to be any declaration in the global scope.
The global $foo
declarations that you see in the functions where $foo is used are sufficient.
It can easily be the case that the global variable is only referenced from within these functions.
The following code works, for example:
function print_it() {
global $my_global;
echo $my_global;
}
function set_it() {
global $my_global;
$my_global = 17;
}
set_it();
print_it(); // echos 17
Upvotes: 0
Reputation: 106
Are you using an IDE? If so you could always do a project wide search for the specific variable.
Otherwise text editors like Notepad++ have a "Open folder as workspace" option. Doing this then running a search should help.
Upvotes: 2