note 43516 added to language.constants
| From: | kstanley at rn2 dot php dot net | Date: | Thu, 24 Jun 2004 07:34:25 +0000 |
| Subject: | note 43516 added to language.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71565@lists.php.net to get a copy of this message | ||
It isn't specifically outlined anywhere (that I could find) in the documentation, but the only
way to access defined constants in a member function of a class is to assign it from the
constructor:
define('FOO', 'BAR');
class Test {
function Test() {
$blah = FOO;
}
function Werd() {
echo $this->blah; // Outputs BAR
echo FOO; // Outputs nada, zip, zero, zilch, nothing. :'(
}
}
Then again, I could be the only one wanting to do this. ^_^
----
Manual Page -- http://www.php.net/manual/en/language.constants.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43516
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43516&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43516&report=yes
Search -- http://master.php.net/manage/user-notes.php