#34634 [NEW]: "const FOO = 1<<0" bits not allowed

From: Date: Sun, 25 Sep 2005 13:18:44 +0000
Subject: #34634 [NEW]: "const FOO = 1<<0" bits not allowed
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85560@lists.php.net to get a copy of this message
From: djmaze at cpgnuke dot com Operating system: Linux PHP version: 5.0.5 PHP Bug Type: Feature/Change Request Bug description: "const FOO = 1<<0" bits not allowed Description: ------------ The manual at following address doesn't explain what kind of constants you may define. http://www.php.net/manual/en/language.oop5.constants.php I've tried to use bits but PHP 5 generates a parse errors on those as well. Either add in the documentation which are allowed or extend the use of const. Reproduce code: --------------- <?php class bar { const ASSOC = 1<<0; # CRASH const SQL_ASSOC = MYSQL_ASSOC; # Works } ?> Expected result: ---------------- A constant bit Actual result: -------------- Parse error: syntax error, unexpected T_SL, expecting ',' or ';' -- Edit bug report at http://bugs.php.net/?id=34634&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34634&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34634&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34634&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34634&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34634&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34634&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34634&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34634&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34634&r=support Expected behavior: http://bugs.php.net/fix.php?id=34634&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34634&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34634&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34634&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34634&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34634&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34634&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34634&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34634&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34634&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34634&r=mysqlcfg

« previous php.bugs (#85560) next »