Pet*_*uza 2 php static reference class this
我知道它不会完全等同于$ this,但是有没有办法从内部引用静态类而不使用类本身的名称?(就像超级本身一样)这只是一种避免在重命名类时重构所有类引用的方法.
例:
class foo {
function bar() {
static_this::method();
// instead of:
foo::method();
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
211 次 |
最近记录: |