Re: [PHP-DEV] Bitwise Declaration of Flags

2009-09-27 Thread Clint Priest
Don't you mean it's NOT valid syntax? Derick Rethans wrote: On Sun, 27 Sep 2009, jvlad wrote: This is not allowed since declaration values should be resolvable at compile time. I.e. they can not be an expression, but only a value literal. While technically expression folding is possible,

Re: [PHP-DEV] Bitwise Declaration of Flags

2009-09-27 Thread Derick Rethans
On Sun, 27 Sep 2009, jvlad wrote: > > This is not allowed since declaration values should be resolvable at > > compile time. I.e. they can not be an expression, but only a value > > literal. > > > > While technically expression folding is possible, it's not > > implemented in any part of the PH

Re: [PHP-DEV] Bitwise Declaration of Flags

2009-09-27 Thread jvlad
> Hi, > > This is not allowed since declaration values should be resolvable at > compile time. I.e. they can not be an expression, but only a value > literal. > > While technically expression folding is possible, it's not implemented in > any part of the PHP engine (AFAIK), and I don't think it'

Re: [PHP-DEV] Bitwise Declaration of Flags

2009-09-27 Thread Stan Vassilev
Are there any plans to allow bitwise declaration of flags? Example: class foo { const FLAG_1 = 1; const FLAG_2 = 2; const FLAG_3 = 4; private $Flags = self::FLAG_1 | self::FLAG_3 } Hi, This is not allowed since declaration values should be resolvable at compile time. I.e. they

[PHP-DEV] Bitwise Declaration of Flags

2009-09-26 Thread Clint Priest
Are there any plans to allow bitwise declaration of flags? Example: class foo { const FLAG_1 = 1; const FLAG_2 = 2; const FLAG_3 = 4; private $Flags = self::FLAG_1 | self::FLAG_3 } The above doesn't work, gets a syntax error on the | operator. Has anyone thought about a change to