globalize vs pass as argument

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Overunner
Forum Newbie
Posts: 9
Joined: Sat Dec 13, 2003 5:28 am

globalize vs pass as argument

Post by Overunner »

Well, the topic is pretty much my question. On the project I am working on I chose to set 'important variables' as session variables and the globalize them (global $HTTP_SESSTION_VARS;) so that they can be accessed within functions. However, I could also call the function and pass that variable as a argument. But my question is, which method do you prefer? Which is safer?
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

There was a discussion on this not too long ago. Check it out:
viewtopic.php?t=15177
Post Reply