什么时候使用Self超过$这个?在PHP 5中,使用self和$this?什么时候合适?
3 回答
qq_花开花谢_0
TA贡献1835条经验 获得超7个赞
self::static::
self::
class Person{
public static function status()
{
self::getStatus();
}
protected static function getStatus()
{
echo "Person is alive";
}}Person::status()
class Deceased extends Person{
protected static function getStatus()
{
echo "Person is deceased";
}}Deceased::status()self::getStatus()
static::status()static::getStatus()
$this->static::
- 3 回答
- 0 关注
- 672 浏览
添加回答
举报
0/150
提交
取消
