php有类,而在调用类中的变量和函数时,其调用形式会略有不同 (主要注意$的位置)
(1) 对变量的调用
1 、const 常量: const MAX = 10; 在类中调用该常量时,采用的形式: self::MAX;
2、 普遍变量: $age = 10; 在类中调用时,采用的形式: $this->age;
3、static变量:static $num = 1; 在类中调用时,采用的形式: self::$num;
(2)对函数的调用
1、普通函数:function get(); 在类中调用时,采用的形式: $this->get();
2、static函数: static function insert(); 在类中调用时,采用的形式: self::insert();
732



被折叠的 条评论
为什么被折叠?



