|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-29 09:43 UTC] amt@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 11 04:00:01 2025 UTC |
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 ...