#php #pemograman-berorientasi-objek-di-php #dasar-pemograman-berorientasi-objek-pbo-di-php
Petunjuk Diskusi
class Orang { public $lokasi = "codesaya"; public $nama; public $umur; public function __construct($nama, $umur) { $this->nama = $nama; $this->umur = $umur; } public function menyapa(){ return "Hi, saya $this->nama umur saya $this->umur."; } } $saya = new Orang("Rasmus Lerdorf", 44); echo $saya->menyapa();
0 jempol