class handphone{
public $kamera;
public $tahun;
public $layar_sentuh= true;
public function __construct($kamera,$tahun)
{
$this->kamera=$kamera;
$this->tahun=$tahun;
}
function ambil_photo()
{
return "$this->kamera jepret..!!";
}
}
$canggih = new handphone("8 Megapixels",2013);
$jadul = new handphone("2 Megapixels",2012);
$jadul=$layar_sentuh=false;
echo canggih->ambil_photo();
salah dimana? errornya syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ',' or ';' in your code on line 20
0 jempol