RE: [PHP] define (true/false)

From: Date: Thu, 28 Jul 2005 13:55:37 +0000
Subject: RE: [PHP] define (true/false)
Groups: php.general 
Request: Send a blank email to php-general+get-219514@lists.php.net to get a copy of this message
[snip] > I may be misunderstanding you here, but I don't see why you would not > want to use a variable to define a constant. I do it from time to time, > most common would be in a config document where I'll check if the page > is being accessed via http or https, and define a constant based on > that. I know I could use a variable for this, but I like using the > constant for it's global scope in that case. now that was exactly my reasoning ... but I very much appriciate the input of the more experienced/older/classically-trained (as apposed to my completely -self-taught-not-backed-up-with-any-solid-computer-science-theory-skills ) guys out there (hey Jay it's a compliment ;-) [/snip] Thanks bro'. I just realized that this is my 30th year of programming formally. In John's reasoning it works OK, because the constant is set once (because you do have to define it somewhere) and then left alone. I just didn't see that reasoning earlier in the thread.

« previous php.general (#219514) next »