[UPHPU] $GLOBALS and global best practices
steve-uphpu at spamwiz.com
Mon Nov 7 10:58:29 MST 2011
On 11/7/11 10:39 AM, Wade Preston Shearer wrote:
> What are the groups thoughts on use of the $GLOBALS superglobal and
> using the global command to pull variables into scope? Are there
> times when using these are considered good practice or would good
> architecture always provide an alternate solution (such as passing
> the variable into the function)?
I'm not sure using a global is ever "best practice", but sometimes it's
almost an unavoidable evil.... Usually, if you're considering it, it
means that you screwed something up with your architecture when you
designed it 6 months ago, and it's too late to fix it now.
More information about the UPHPU