NYCPHP Meetup

NYPHP.org

[nycphp-talk] constants vs globals

Adam Maccabee Trachtenberg adam at trachtenberg.com
Fri Feb 20 17:28:42 EST 2004


On Fri, 20 Feb 2004, Dan Cech wrote:

> Personally I use constants for data which is just that, something which
> is not going to be different depending on the time of day, direction of
> the wind, etc.  Anything else that I need either goes into the
> appropriate class or $GLOBALS['config'].

I am with Dan here. I rarely use constants, but when I do they're for
stuff like PI. (Okay, that's built in, but you get the point.)

Worrying about speed here is far less worrysome that accidentally
defining the ratio of the circumference to the diameter of a circle. :)

-adam

-- 
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!



More information about the talk mailing list