abstract:class Mobile { public $brand; //品牌 public $model; //型號 public $price; //價格
class Mobile { public $brand; //品牌 public $model; //型號 public $price; //價格 public function __construct($brand, $model, $price) { $this->brand = $brand; $this->model = $model; $this->price = $price; } } spl_autoload_register(function ($className) { require __DIR__ . '/public/' . $className . '.php'; }); $mobile = new Mobile('vivo', 'nex S', 5800); echo $mobile->brand . $mobile->model . ':' . $mobile->price, '<br>';
Correcting teacher:查無此人Correction time:2019-04-19 09:20:59
Teacher's summary:完成的不錯。類自動加載,減少代碼量,也增加運行速度。繼續(xù)加油