|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-03 13:43 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 23:00:01 2025 UTC |
Description: ------------ In a class, a constant cannot have visibility modifiers. This is weird. In other languages, like Java, constants can be public or private, etc. Reproduce code: --------------- <? class MyClass{ private const foo = "foo"; } ?> Expected result: ---------------- No runtime errors. Actual result: -------------- Parse error: syntax error, unexpected T_CONST, expecting T_VARIABLE in D:\Develop\www\teste\const.php on line 4