Edit report at https://bugs.php.net/bug.php?id=27022&edit=1
ID: 27022
Updated by: [email protected]
Reported by: [email protected]
Summary: Class constant has no visibility modificator
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: *
PHP Version: 7.0
-Assigned To:
+Assigned To: seander
Block user comment: N
Private report: N
New Comment:
This was merged and available in master, the first release that will have it is (7.1)
thanks!
Previous Comments:
------------------------------------------------------------------------
[2015-08-19 19:14:25] sean at siobud dot com
This seems to be a dupe of https://bugs.php.net/bug.php?id=69980
I started working on this, and will open a PR against php-src in the next couple of days. I don't intended on it getting merged anytime soon, but it is fun to work on.
------------------------------------------------------------------------
[2015-01-08 22:40:24] [email protected]
This looks reasonable, bumping version.
------------------------------------------------------------------------
[2011-09-15 09:01:52] pulzarraider at gmail dot com
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.
------------------------------------------------------------------------
[2004-01-23 12:47:45] [email protected]
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.