Constants and includes
Posted: Thu Nov 18, 2004 10:29 am
Something really weird happening...PHP 5.....
I include a file at the top of a script, the included file defines some constants.
Then later on in the script, I include another file that has some lines that echo the values of those defined constants. Thing is, the included file doesn't have access to those constants.....
I proved it by using get_defined_constants from within the included code...and the constants array does NOT contain a USER array.
As I understand it, included files should have access to vars of all scopes that have been defined in the original script up to that point.
What gives? Anyone?
I include a file at the top of a script, the included file defines some constants.
Then later on in the script, I include another file that has some lines that echo the values of those defined constants. Thing is, the included file doesn't have access to those constants.....
I proved it by using get_defined_constants from within the included code...and the constants array does NOT contain a USER array.
As I understand it, included files should have access to vars of all scopes that have been defined in the original script up to that point.
What gives? Anyone?