> 其他 >
php中::是什么意思?
人气:329 ℃ 时间:2020-07-01 19:15:53
解答
类中 静态方法和静态属性的引用方法
例如
class Test{
public static $test = 1;
public static function test(){
}
}
可以不用实例化对象直接使用 Test::$test 来取得$test属性的值
静态方法调用也同理Test::test(); 直接调用静态方法test
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版