开发者

Access control in PHP5 const property

Is it possible to do something like this?:

class MyClass {
  private const MYCONST = 'JUMP';
}

My point is, can consts have "access control" (public, priva开发者_运维知识库te, protected)?


It's not possible. Class constants are always globally accessible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜