Ken2k7 Posted January 24, 2008 Share Posted January 24, 2008 I asked this question about a month ago and someone said that there is no advantages to globals. So are there any disadvantages? Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/ Share on other sites More sharing options...
revraz Posted January 24, 2008 Share Posted January 24, 2008 What are you using them for? I would think it would depend on the circumstance. Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447447 Share on other sites More sharing options...
Ken2k7 Posted January 24, 2008 Author Share Posted January 24, 2008 Just a general question. Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447449 Share on other sites More sharing options...
phpSensei Posted January 24, 2008 Share Posted January 24, 2008 This feature is DEPRECATED and REMOVED as of PHP 6.0.0. I really see no advantages in it, please share the light if anyone does. Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447450 Share on other sites More sharing options...
Ken2k7 Posted January 24, 2008 Author Share Posted January 24, 2008 Well someone did say that it reduces unnecessary work and processor time. Don't know what that means though. But my question is are there any DISADVANTAGES? Thanks in advance, Ken Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447451 Share on other sites More sharing options...
teng84 Posted January 24, 2008 Share Posted January 24, 2008 i use global if needed eg.. if i need to use var inside the function Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447475 Share on other sites More sharing options...
Ken2k7 Posted January 24, 2008 Author Share Posted January 24, 2008 Okay. So anyone else have an input on this? Just questioning. Thanks, Ken Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447783 Share on other sites More sharing options...
PFMaBiSmAd Posted January 24, 2008 Share Posted January 24, 2008 Define exactly what "Globals" you are referring to. There are register globals (a security risk, depreciated, turned off by default long ago, and eliminated in php6), the global keyword to reference variables inside functions, the $GLOBALS array of all variables, or the auto-global arrays $_POST/$_GET/$_COOKIE/$_FILES/$_SESSION. Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447786 Share on other sites More sharing options...
Ken2k7 Posted January 24, 2008 Author Share Posted January 24, 2008 Global variables. Quote Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447890 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.