Superian Posted July 17, 2008 Share Posted July 17, 2008 I've read the article on php.net but I am still not getting it. Could someone please explain to me in depth about how to use variable scope correctly? Link to comment https://forums.phpfreaks.com/topic/115158-static-vs-global/ Share on other sites More sharing options...
cooldude832 Posted July 17, 2008 Share Posted July 17, 2008 You shouldn't need to use scope at all if u write your functions properly There are 3/4 "levels" to concern youself with Super global (accessible anywhere) Global (accessible in global and in functions through global calling) Object internal (accessible in class as $this->VARNAME or in global as $objectvarname->varname) Function vars (Only in function only way out is through a return or altercation of a global variable) Link to comment https://forums.phpfreaks.com/topic/115158-static-vs-global/#findComment-592167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.