PHP5 class constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,

I think I've found a bug. I have a bunch of constants, and I'd like to present them as flags. While I can do

class Foo {
   const AAA = 1;
   const BBB = 2;
   const CCC = 4;
   const DDD = 8;
}

and it works fine, I cannot define a constant by expression, like:

class Foo {
   const AAA = 1 << 0;
   const BBB = 1 << 1;
   const CCC = 1 << 2;
   const DDD =1 << 3;
}

Well now, is this a bug, and I should file it, or is it, and why, normal?

bye,
N::

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux