Code: Select all
global $x;
unset($x);Just add these to the reasons that it is not good practice to use global vars. Not much you can do because you are dealing with an existing, poorly coded, application.
Moderator: General Moderators
Code: Select all
global $x;
unset($x);Yes, using global is a bad practice and generates security flaws as well.arborint wrote:When you do:I believe you are unsetting a reference to the global var ... which is really decrementing the reference count. Whereas I believe $GLOBALS['x'] is the actual var. It is a feature of PHP variables.Code: Select all
global $x; unset($x);
Just add these to the reasons that it is not good practice to use global vars. Not much you can do because you are dealing with an existing, poorly coded, application.