<?php
class Roti {
    private $id_roti;
    private $nama_roti;
    private $harga;

    public function __construct($id_roti, $nama_roti, $harga) {
        $this->id_roti = $id_roti;
        $this->nama_roti = $nama_roti;
        $this->harga = $harga;
    }

    public function getId_roti() {
        return $this->id_roti;
    }
    public function getNama_roti() {
        return $this->nama_roti;
    }
    public function getHarga() {
        return $this->harga;
    }
}

$roti1 = new Roti("ROT001", "Roti Sobek Cokelat", "Rp 15.000");
?>

<p>Nama: MUHAMMAD MAULIADI</p>
<p>NIM: [2455208063]</p>
<p>Kelas: 4RPL</p>
<p>Prodi: Ilmu Komputer</p>
<hr><br>

<h2>DETAIL PRODUK ROTI</h2>
<p>Id Roti: <?= $roti1->getId_roti(); ?></p>
<p>Nama Roti: <?= $roti1->getNama_roti(); ?></p>
<p>Harga: <?= $roti1->getHarga(); ?></p>