Начал изучать ООП в пхп, пишу код как говорится в видео уроке но выдается ошибка:
Fatal error: Class Car contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Car::showInfo) in C:\OSPanel\domains\localhost\index.php on line 30
Вот код:
<?php
class Car {
public $name;
public $year;
public $type;
protected $hp;
protected $price;
function con ($name,$year, $type, $hp, $price) {
$this->name = $name;
$this->year = $year;
$this->type = $type;
$this->hp = $hp;
$this->price = $price;
}
public function tuning() {
$this->hp += 50;
}
public function showHp() {
echo $this->hp;
}
abstract public function showInfo();
}
class Mustang extends Car {
public function tuning() {
parent::tuning();
$this->hp += 450;
}
public function showInfo() {
echo $this->name;
}
}
$mustangGT = new Mustang();
$mustangGT->con('Mustang GT', 2017, 'Muscle car', '900' , 39000);
echo $mustangGT->showHp();
$mustangGT->tuning();
echo "<br>";
echo $mustangGT->showHp();
?>
Что я не правильно понял?