superglobals and php |
|
Don't you have to put "global $db_server;" within the function? E.g.
Include file:
Main file:
You can see more info here. |
||||||||||||||||
|
|
Thanks for the link.
I'm sorry I wasn't clear about my top example. The reason I used the global $variable; in the top file, was because it was also within a function. I've had a closer look, and it seems that the issue is the debugger not being able to handle the use of $GLOBAL['variable_name'] within quotes. For example: PHP5 (and PHP4 for that matter) correctly recognise the following:
While, the debugger must have the global variable presented in the following fashion (outside of the quotes):
Is there a setting I can change to allow the debugger to handle global variables in the manner of the first example? Thanks, Rich |
||||||||||||||||
|
Site Admin
|
Dear Rich,
Debugger does never recognize any variables whatever... it's just not its job. Please consider debugger as a mirror. It reflects what php engine is doing. If PHP does not understand your code, debugger will show you so. |
||||||||||||
_________________ The PHP IDE team |
Veteran
|
You need to at least put the array index (time_of_day) into single quotes there. It'll work without them most of the time, but not always, and it is technically an error to skip them. The only reason it works at all is because of an implementation detail in PHP.
I long ago gave up trying to directly include anything but simple variable references in strings without bracketing them; I just found too often that, even when it did work, I'd later need to make a change that broke it. So now I just always put braces around the reference:
Good luck. |
||||||||||||||||||||||
|
|
Thanks for your responses gents. and thanks, Bob, for the clarification.
|
||||||||||||
|
superglobals and php |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by