At 8:46 AM -0400 9/15/10, Peter van der Does wrote:
Hi,

How do you people store data that doesn't change, an example of this
would be the version number of your software. You might want to use it
through out your program but how to you store it?

As far as I can see there are several options to use this data.
1. Global Variable
2. Store it in a registry class
3. Store it in a named constant.
4. Use a function that will return the data (kind of like a regsitry
class but it's not a class)

Personally I don't like option 1 but what about the other options. Is
any of them faster then the others. What other pros and cons are there.

Make it's a Constant -- it's simply a Global that doesn't change.

I typically hold such things in a global configuration file that can be included when needed.

Cheers,

tedd

--
-------
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to