批改状态:合格
老师批语:以现在正在学的内容为主写作业, 之前可在休课期间完成比较好,推荐
<?phpclass User1 extends User{public static $name = '小龙虾';public static $money = '38元/斤';public static function Demo(){return self::$name . '现在促销中只需' . self::$money;}}class User2 extends User{public static $name = '帝王蟹';public static $money = '108元/斤';public static function Demo(){return self::$name . '现在促销中只需' . self::$money;}}echo User::Demo(), '<hr>';echo User2::Demo();

<?phpabstract class User{public static $name = '鲍鱼';public static $money = '78元/斤';public static function Demo(){return self::$name . '现在促销中只需' . self::$money;}}class User1 extends User{public static $name = '小龙虾';public static $money = '38元/斤';}class User2 extends User{public static $name = '帝王蟹';public static $money = '108元/斤';}echo User::Demo(), '<hr>';echo User2::Demo();

<?phpabstract class User{public static $name = '鲍鱼';public static $money = '78元/斤';public static function Demo(){return static::$name . '现在促销中只需' . static::$money;}}class User1 extends User{public static $name = '小龙虾';public static $money = '38元/斤';}class User2 extends User{public static $name = '帝王蟹';public static $money = '108元/斤';}echo User1::Demo(), '<hr>';echo User2::Demo();

1.了解了静态绑定会解决怎样的问题
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号