Req #27022 [Com]: Class constant has no visibility modificator

From: Date: Thu, 15 Sep 2011 09:01:52 +0000
Subject: Req #27022 [Com]: Class constant has no visibility modificator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163551@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=27022&edit=1

 ID:                 27022
 Comment by:         pulzarraider at gmail dot com
 Reported by:        andrey@php.net
 Summary:            Class constant has no visibility modificator
 Status:             Open
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 Operating System:   *
 PHP Version:        5CVS-2004-01-23 (dev)
 Block user comment: N
 Private report:     N

 New Comment:

It would be great if php will have private/protected constants inside classes. It's very
important feature for every real object programming language. If it would be available, the status
of PHP, as a programming language, will grow.


Previous Comments:
------------------------------------------------------------------------
[2004-01-23 12:47:45] andrey@php.net

Description:
------------
It is not possible to use visibility modificator like public/protected/private on a class constant.

Reproduce code:
---------------
php -r "class fubar { protected const some_const = 123; }"

Actual result:
--------------
PHP Parse error:  parse error, unexpected T_CONST, expecting T_VARIABLE in Command line code on line
1


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



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


Thread (8 messages)

« previous php.bugs (#163551) next »