Class constant based on other class constants
Posted: Thu Mar 29, 2007 5:08 am
Using PHP 5.2.1 :
I get
Is a way to create a class-constant based on other class-constants ?
Thanks
Code: Select all
class cls
{
const a = 1;
const b = 2;
const c = 4;
const x = self::a + self::b + self::c; // Error
}Code: Select all
Parse error: syntax error, unexpected '+', expecting ',' or ';' in xxx.php on line [i]nn[/i]Thanks