PHP globals

sclewin

New Member
Messages
88
Reaction score
0
Points
0
Hi all,

I'm currently designing a page and I am making use of PHP. I have noticed more and more I am depending on making variables global in the functions I create. I find using global variables to be very easy to use and work well. My question is using globals in PHP evil at all. Are there any problems I could run into for using globals or are globals considered bad programming practice at all?
 

sclewin

New Member
Messages
88
Reaction score
0
Points
0
I never thought that.
Theres always session cookies.

Thank you, but I would like to keep everything server side. It is for a PBEM game and the script will be run from a cron job.
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
globals shouldn't be any harm, since they act just like every other variable.
 

DarkDragonLord

New Member
Messages
782
Reaction score
0
Points
0
Well, just to know, in PHP 6:
# Will not have register_globals;
# Will not have magic_quotes_*;
# Will not have safe_mode;
# Identifiers will be case-sensitive.

So, never use Register_globals. Since x10 is always up-to-date with PHP, when 6 comes in stable, these i told and some some will not work ;D
 
Top