Re: define() or $variable for application settings?

From: Date: Thu, 09 Feb 2006 13:17:07 +0000
Subject: Re: define() or $variable for application settings?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-230150@lists.php.net to get a copy of this message
On 2/9/06, Jochem Maas <jochem@iamjochem.com> wrote: > bare in mind though that define() is horribly slow (to paraphrase > Rasmus) which may be the reason many projects choose to use variables > instead. see here: Thanks Chris and Jochem! That should've been my follow up question - which is, if define() is a lot safer and more elegant to use than variables, why do many projects use variables? Would you guys know why this is so? AFAIK, in compiled languages like C, constants are faster because the preprocessor expands them at compile-time rather than being allocated memory during run-time - but then we're talking about PHP here. -- Stand before it and there is no beginning. Follow it and there is no end. Stay with the ancient Tao, Move with the present.

« previous php.general (#230150) next »