note 74163 deleted from language.oop5.constants by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Aug 2011 13:29:41 +0000 |
| Subject: | note 74163 deleted from language.oop5.constants by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182178@lists.php.net to get a copy of this message | ||
Note Submitter: kevin at metalaxe dot com
----
gt at realvertex.com
You miss the point. Allowing dynamically assigned class constants will prevent the cluttering of
global constants and allow you to even protect the accessibility of said constants to prevent
conflicts. For example, the constants for class MySQL won't be directly available to the class
Display. So I don't have to worry about prefixing all of my constants (which shouldn't be
necessary and is just plain ugly).
Either way, class constants simply do not follow the global constant operation. You are allowed to
set a global constant at any time during the script, yet class constants are only allowed to be set
in the class header and are processed prior to script execution.
michikono at symbol gmail dot com:
This is an interesting solution and I think I will implement it as a temporary "solution"
to the constant issue. Thank you for taking the time to post!