What does “throughout a script” mean? When are 2 php documents part of a same script and when are they not?
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.
“Throughout a script” means “throughout one invocation of the PHP interpreter”. Here are some typical situations:
include()s orrequire()s Script B: The superglobals will transmute from Script A to Script Beval()s some code: The superglobals will transmute from the script to the argument of the evaluation.This is different to “super-defines” such as
__FILE__, as superglobals will be constant (if not manually changed) throughout the invocation, while super-defines will not.In addition to that, the superglobals will allways be in scope, even if inside a function or class without explicitly being
globaled