摘要:<?php class Father{ public static $money = 52000; public static function getClass(){ &nbs
<?php
class Father{
public static $money = 52000;
public static function getClass(){
return __CLASS__ ;
}
public static function getMoney(){
// return self::getClass().'::'.self::$money;
return static::getClass().'::'.static::$money;
}
}
echo '类名 : '.Father::getClass()."<hr>";
echo '方法 : '.Father::getMoney(),"<hr>";
class Son extends Father{
public static $money = 12000;
public static function getClass(){
return __CLASS__ ;
}
}
echo "<hr>";
echo Son::$money;
echo "<hr>";
echo Son::getClass();
echo "<hr>";
echo Son::getMoney();
?>
批改老师:查无此人批改时间:2019-05-07 09:49:34
老师总结:完成的不错。学习完类以后,就相当于php入门了。继续加油