为什么会有Warning错误以下是警告错误信息:我的车Porsche价格是1000000 Warning:Missing argument 1 for MyCar::__construct(),called in PHPDocument1 on line 28 and defined in PHPDocument1 on line 5 Warning:Missing argument 2 for MyCar:

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/02 20:18:21

为什么会有Warning错误
以下是警告错误信息:我的车Porsche价格是1000000 Warning:Missing argument 1 for MyCar::__construct(),called in PHPDocument1 on line 28 and defined in PHPDocument1 on line 5 Warning:Missing argument 2 for MyCar::__construct(),called in PHPDocument1 on line 28 and defined in PHPDocument1 on line 5 我得新车是奔驰价格是10231000

class myCarInfo extends MyCar { public $name1="奔驰"; public $price1="10231000"; function __construct(){ } function information() { echo "我得新车是".$this->name1; echo "价格是".$this->price1; } } 承继了父类的构造函数吧