Suggestion for constants required by classes
| From: | Gustavo Narea | Date: | Wed, 11 Jan 2006 20:38:12 +0000 |
| Subject: | Suggestion for constants required by classes | ||
| Groups: | php.pear.qa | ||
| Request: | Send a blank email to pear-qa+get-3373@lists.php.net to get a copy of this message | ||
Dear PEAR QA:
I think constants required by classes should not be defined in a global scope but within the same class. I suggest this because of semantic reasons, as well as in order to avoid them to be already defined in another place within the script.
For instance, use this line in PEAR::DB:
const ERROR = -1;
instead of:
define('DB_ERROR', -1);
What do you think about it? Could it be taken into account for the coding standards?
Thanks for your attention.
Regards.
Gustavo Narea.