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? 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. 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. 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. 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 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 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 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. 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. Link to comment https://forums.phpfreaks.com/topic/87481-globals/#findComment-447890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.