开发者

Access control in PHP5 const property

开发者 https://www.devze.com 2023-02-14 10:13 出处:网络
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 no

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

精彩评论

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