nazev = $nazev; $this->popis = $popis; $this->cena = $cena; $this->skladem = $skladem; } protected function __toString(){ return '

'.$this->nazev.'

'.$this->popis.'

Cena: '.$this->cena.' Kč
Skladem: '.$this->skladem.' ks
'; } } class Pamet extends Zbozi{ public $druh; public $kapacita; public function __construct($nazev, $popis, $cena, $skladem, $druh, $kapacita){ parent::__construct($nazev, $popis, $cena, $skladem); $this->druh = $druh; $this->kapacita = $kapacita; } public function __toString(){ $text = parent::__toString(); $text .= 'Druh: '.$this->druh.'
Kapacita: '.$this->kapacita.'

'; return $text; } } class Procesor extends Zbozi{ public $patice; public $pocetJader; public $frekvence; public function __construct($nazev, $popis, $cena, $skladem, $patice, $pocetJader, $frekvence){ parent::__construct($nazev, $popis, $cena, $skladem); $this->patice = $patice; $this->pocetJader = $pocetJader; $this->frekvence = $frekvence; } public function __toString(){ $text = parent::__toString(); $text .= 'Patice: '.$this->patice.'
Počet jader: '.$this->pocetJader.'
Frekvence: '.$this->frekvence.'

'; return $text; } } $disk1 = new Pamet("1TB SSD disk", "SSD pevný disk o kapacitě 1TB.", 2000, 5, "SSD", "1TB"); echo $disk1; $procesor1 = new Procesor("Intel I5", "Procesor Intel I5 3,4GHz", 5000, 12, "LGA 1700", 14, "3,4GHz"); echo $procesor1; ?>