note 43516 deleted from language.constants by nlopess
| From: | nlopess@php.net | Date: | Thu, 24 Jun 2004 08:36:04 +0000 |
| Subject: | note 43516 deleted from language.constants by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71566@lists.php.net to get a copy of this message | ||
Note Submitter: kstanley (at) kennethpaul (dot) com
----
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. ^_^