Search found 5 matches

by thowden
Wed Jan 10, 2007 8:35 pm
Forum: PHP - Code
Topic: $GLOBAL, global, and scope theory question.
Replies: 16
Views: 995

Hi Thanks. *Slaps forehead* Doh!@ $GLOBAL[variable] is NOT $GLOBALS[variable] See what happens when you leave an S out ! Hence none of my little tests worked before. So global $variable; as a statement is not putting the $variable but getting the $variable ? Thanks 'arborint' for the clue in your sa...
by thowden
Wed Jan 10, 2007 7:39 pm
Forum: PHP - Code
Topic: $GLOBAL, global, and scope theory question.
Replies: 16
Views: 995

Script files are no scope boundaries. Multiple instances of a class running in the same php instance share the same global scope and the same array $GLOBALS The output of my little script would still be nice to have. I was drafting the last reply while you were posting. Output done. I am assuming t...
by thowden
Wed Jan 10, 2007 7:29 pm
Forum: PHP - Code
Topic: $GLOBAL, global, and scope theory question.
Replies: 16
Views: 995

Hi What is the relationship between global and $GLOBAL? They use the same/identical internal structure to store data. They use the same structure but echo 'Test<br />'; global $variable; $GLOBAL['variable'] = 'test'; $variable = 'fred'; echo '$variable is set to : '.$variable.' <br />'; echo '$GLOBA...
by thowden
Wed Jan 10, 2007 6:55 pm
Forum: PHP - Code
Topic: $GLOBAL, global, and scope theory question.
Replies: 16
Views: 995

Hi Thanks. Yes I have read this section several times. I understand the concept of scope within a function and a single file or script. My questions are more on scope limits where there are multiple script files and class instances. This doesn't seem to be mentioned in any docs I have read. would th...
by thowden
Wed Jan 10, 2007 5:05 pm
Forum: PHP - Code
Topic: $GLOBAL, global, and scope theory question.
Replies: 16
Views: 995

$GLOBAL, global, and scope theory question.

Hi All I've read and re-read everything on scope, variables, globals, and superglobals and I still cannot quite wrap my head around it. I am maintaining some code written by others and they include in this application the use of $GLOBAL(variable) with the obvious intention that this would make the d...