Are there any other ways to access global context from within a function scope in PHP, outside of $GLOBALS and global? If so, what are they?
Are there any other ways to access global context from within a function scope
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You may wish to reference the PHP manual page on variable scope, which lists two ways to access variables in the global scope: the
globalkeyword and the$GLOBALSsuperglobal. These are your only options.