acctman Posted May 17, 2009 Share Posted May 17, 2009 Is it possible to exit out of all global variables after a script has processed. Quote Link to comment https://forums.phpfreaks.com/topic/158493-exit-global-variables-at-end-of-script/ Share on other sites More sharing options...
wildteen88 Posted May 17, 2009 Share Posted May 17, 2009 What do you mean by "exit out of all global variables"? When PHP finishes executing the script all variables/functions/classes will be unset. PHP does not keep anything in memory after once the script has executed. Quote Link to comment https://forums.phpfreaks.com/topic/158493-exit-global-variables-at-end-of-script/#findComment-835866 Share on other sites More sharing options...
acctman Posted May 17, 2009 Author Share Posted May 17, 2009 What do you mean by "exit out of all global variables"? When PHP finishes executing the script all variables/functions/classes will be unset. PHP does not keep anything in memory after once the script has executed. when i do a file include that has Global vars set, it affects the entire page Quote Link to comment https://forums.phpfreaks.com/topic/158493-exit-global-variables-at-end-of-script/#findComment-835882 Share on other sites More sharing options...
wildteen88 Posted May 17, 2009 Share Posted May 17, 2009 Ofcourse it will. Files that are included do not get parsed seperatory. Your should name your variables differently in your included files, otherwise they will overwrite those in your parent file Quote Link to comment https://forums.phpfreaks.com/topic/158493-exit-global-variables-at-end-of-script/#findComment-835907 Share on other sites More sharing options...
Daniel0 Posted May 17, 2009 Share Posted May 17, 2009 What do you mean by "exit out of all global variables"? When PHP finishes executing the script all variables/functions/classes will be unset. PHP does not keep anything in memory after once the script has executed. when i do a file include that has Global vars set, it affects the entire page Why do you think global variables are considered bad design and bad practice? Quote Link to comment https://forums.phpfreaks.com/topic/158493-exit-global-variables-at-end-of-script/#findComment-835909 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.