|
-
Apr 16th, 2010, 12:14 AM
#4
Thread Starter
Hyperactive Member
Re: php5 - global variable clarification
 Originally Posted by penagate
I prefer not to use globals — for things which require global access, I use static variables in classes.
This approach gives you organisation: you can have a settings class, a database class, and so on.
A function to me should be self-contained (unlike a class method). This means it takes input (arguments) and returns output, which doesn't depend on any other factors.
Baby steps for me dude, learning php as I go. Maybe next verison of the software
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|