This is a static class that commhelper has itself and cannot be instantiated. Because this is an object generated in a static function that has been defined in COMMHELPER. Simply put, this function function returns the static function defined in the test parent class. Just think that the things that the parent class has will be there by default. Use it if you want. More convenient to use.
This is a static class that commhelper has itself and cannot be instantiated. Because this is an object generated in a static function that has been defined in COMMHELPER. Simply put, this function function returns the static function defined in the test parent class. Just think that the things that the parent class has will be there by default. Use it if you want. More convenient to use.
Confused about static in php? - PHP Chinese website Q&A - Confused about static in php? - PHP Chinese website Q&A
Take a look and learn.
首先,你应该先了解static的用法,再去理解你不明白的这段代码的含义。先给你看你一个static使用的例子:
上面输出的是结果是:lisi;也就是数据当前类的属性。
如果本类没有的话,那就代表它的父类中的getSharedConfig()静态方法,这里也可以写成self::getSharedConfig(),父类就是extends 的那个类哈