<?php
class Mahasiswa {
    public $nama;
    public $npm;

    public function __construct($nama, $npm) {
        $this->nama = $nama;
        $this->npm  = $npm;
    }

    public function tampil() {
        echo "Nama: " . $this->nama . " | NPM: " . $this->npm;
    }
}

$mhs1 = new Mahasiswa("Ninda", "202343501608");
$mhs1->tampil();
?>