global $user vs $user = $GLOBALS['user']
by using “global $var” to get a global variable, do we get a copy of the global var or get a reference to that global variable?
global $user;
Is $user a copy of global object or is a reference to actual global variable?
Thanks.
by using it with
global $var;you always have a local variable that references the global variable.Following code:
is equivalent to: