类可以将位移值定义为类常量/静态变量吗?
我想实现一个类似于此处描述的权限系统http://www.litfuel.net/tutorials/bitwise.htm(对不起,我可以从快速谷歌找到最好的例子)
例如我试过这个
类权限{
常量 perm1 =1;
常量 perm2 =2;
常数 perm3 =4;
// - 切 - 
常量 perm24 =8388608;
常量 perm25 = perm1 | 烫发2;
}
这使
语法错误,意外的 '|',需要 ',' 或 ';'
和首选方式
class permissions {
static $perm1 =1<<0;
static $perm2 =1<<1;
static $perm3 =1<<2;
//--CUT--
static $perm24 =1<<23;
static $perm25 = $perm1 | $perm2;
}  
这使
语法错误,意外的 T_SL,需要 ',' 或 ';'
后一种方式在类环境之外工作,例如
$perm1 =1<<0;
$perm2 =1<<1;
$perm3 =1<<2;
//--CUT--
$perm24 =1<<23;
$perm25 = $perm1 | $perm2;
echo $perm25;
给出预期的 3 (2+1) (或 2^0 + 2^1)
在类中定义它的最佳方法是什么?