From: kris dot hofmans at pandora dot be Operating system: Linux 2.6 PHP version: 5.0.0RC1 PHP Bug Type: *General Issues Bug description: const's in classes are no longer recognized, define works again in classes
Description: ------------ I have been using the const in classes since the change from define, this change seems to be reverted in RC1? Since it doesn't recognize the constants, using define in the constructor it works again, but I hope this is not the final behaviour. Reproduce code: --------------- class bleh { const MYCONST = "hello world"; public function printMyConst(){ // doesn't work in RC1 print(MYCONST); } } adding: public function __construct(){ define("MYCONST", "hello world"); } fixes it. Expected result: ---------------- I hope const will be the default behaviour for php5, not reverting to the deprecated php4 define method Actual result: -------------- Use of undefined constant ... -- Edit bug report at http://bugs.php.net/?id=27749&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27749&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27749&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27749&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27749&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27749&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27749&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27749&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27749&r=support Expected behavior: http://bugs.php.net/fix.php?id=27749&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27749&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27749&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27749&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27749&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27749&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27749&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27749&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27749&r=float