Using $GLOBALS

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
fastfingertips
Forum Contributor
Posts: 242
Joined: Sun Dec 28, 2003 1:40 am
Contact:

Using $GLOBALS

Post by fastfingertips »

Is it safe to use globals in an application. Can conduct to security leaks?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Using them blind is not, but as long as you always initialize them, it can be okay. Something you have to be careful of is accidental overrides of existing, in use, globals.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

we had this discussion a little ago :arrow: viewtopic.php?t=44813&highlight=globals+evil

Enjoy.
Post Reply