Re: define (true/false)
| From: | Vidyut Luther | Date: | Thu, 28 Jul 2005 12:58:13 +0000 |
| Subject: | Re: define (true/false) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-219495@lists.php.net to get a copy of this message | ||
Exactly,
CONSTANTS are ... "eternal truths" to the program, they shouldn't change, constants should not be changing based on arguments being passed, or other variables.
by definition, it's no longer a constant, and a misuse of the define() function.
On Jul 28, 2005, at 8:46 AM, Jay Blanchard wrote:
[snip] WHY? [/snip] [moresnip] But you would never want to use a variable to determine a constant because the variable is not likely to be the same (that is why we call them variables) on any iteration. Using constants in expressions is OK, for instance if(BAR == $foo){ ...stuff... } But modifying a constant is a no-no. [/moresnip]