note 26814 added to keyword.paamayim-nekudotayim
| From: | frederik at rack1 dot php dot net | Date: | Wed, 13 Nov 2002 20:46:35 +0000 |
| Subject: | note 26814 added to keyword.paamayim-nekudotayim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39456@lists.php.net to get a copy of this message | ||
My approach to using class constants is by making them functions.
Instead of
$var CONSTANT = 1;
I use
function CONSTANT { return 1; }
Now, when using this:
$i = ConstantClass::CONSTANT();
You can do anything with it: comparing, addition, multiplication. The syntax is a bit weird, but it
works perfectly.
--
http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php
http://master.php.net/manage/user-notes.php?action=edit+26814
http://master.php.net/manage/user-notes.php?action=delete+26814
http://master.php.net/manage/user-notes.php?action=reject+26814