Class constants
| From: | Gary . | Date: | Mon, 19 Apr 2010 08:30:26 +0000 |
| Subject: | Class constants | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-304195@lists.php.net to get a copy of this message | ||
Should I be able to do this:
class X
{
const FOO = 'foo';
const FOOBAR = X::FOO . 'bar';
...
}
?
Because I can't. I get "syntax error, unexpected '.', expecting ',' or
';'". I assume this is because the constants are like statics which
can't be initialised by functions etc. but is there really any logic
behind this?