Constants inside classes
| From: | garyb at fxt dot com | Date: | Tue, 11 Jan 2000 07:03:52 +0000 |
| Subject: | Constants inside classes | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-9028@lists.php.net to get a copy of this message | ||
Folks,
This is really an object-newbie question, but it relates to design of PHP. I
have figured out that it is not legal to DEFINE a constant inside a class -
a constant must be global. One can have the same effect by creating a var
inside the class that one doesn't modify, of course. But that's not quite
the same thing (it requires that teensy amount of discipline.)
Why?
Is this because the DEFINEd constants are more static than classes in some way?
G