Req #46216 [Opn->Bgs]: enhance const declaration

From: Date: Tue, 28 Dec 2010 11:47:25 +0000
Subject: Req #46216 [Opn->Bgs]: enhance const declaration
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-157356@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=46216&edit=1

 ID:                 46216
 Updated by:         jani@php.net
 Reported by:        xigamy at gmail dot com
 Summary:            enhance const declaration
-Status:             Open
+Status:             Bogus
 Type:               Feature/Change Request
-Package:            Feature/Change Request
+Package:            *General Issues
 Operating System:   *
 PHP Version:        5.2.6
 Block user comment: N
 Private report:     N

 New Comment:

See bug #30177


Previous Comments:
------------------------------------------------------------------------
[2008-10-02 08:51:26] xigamy at gmail dot com

Description:
------------
I cannot declare a const a i would like to although i only use constant
data.
imho a concatenation of constant strings should be possible. the same as
any operation on only constant values should be allowed.
please? :-D

Reproduce code:
---------------
class SiteConfig {
  const HOST = 'www.test.com';
  const DOC_ROOT = '/sites/aa/2484356/htdocs/';
  const WEBMASTER_MAIL = 'webmaster@test.com';
  const DEBUG = false;
}

class AppConfig {
	const HOME = SiteConfig::DOC_ROOT.'inc/lib/app/';
}

Expected result:
----------------
AppConfig::HOME == '/sites/aa/2484356/htdocs/inc/lib/app/'

Actual result:
--------------
syntax error


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=46216&edit=1


Thread (2 messages)

« previous php.bugs (#157356) next »