A few things here.
Firstly, register_globals, which you disabled in php.ini, refers to an old PHP function, where any variable sent via a query string (GET) or form (GET / POST) will be converted to a global PHP variable. This is a function that (and should be) disabled when register_globals is disabled. Even so, you can define global variables in your application.
In general terms of programming, global variables (not PHP register_globals) are considered "bad" because when you encounter one of them as a programmer, you have no idea what other parts of the application can use or modify it or that changes to this global can occur . Also, if you define a new global variable, you can overwrite the existing variable that someone else relies on. When variables are defined locally (in one function or in other languages, one block), you can check the local area and usually determine what the change of this variable will do.
Constants, on the other hand, never change. You define them once, and they remain defined, and no one can change them. This is why global constants are considered "less bad" than global variables.
Alan storm
source share