diff --git a/_includes/Mic.class.php b/_includes/Mic.class.php index 4b826107882806e6507c851c067704e7364b4510..20a968cdb1553f888d7116da7c5b8a4aca7e6778 100644 --- a/_includes/Mic.class.php +++ b/_includes/Mic.class.php @@ -8,4 +8,10 @@ class Mic public $model; public $light; public $price; + + // Creating methods.. + public function setLight($light){ + print($light); + print($this -> light); + } } diff --git a/test.php b/test.php index b3ed80dda9fac206497aaec03d7ce7e8b4772226..f8c866c89f8e7717f31f9181e9214474860fe4e6 100644 --- a/test.php +++ b/test.php @@ -27,6 +27,9 @@ $mic1->brand = "Toyota"; $mic2 -> brand = "Hyundai"; + $mic1 -> light = "RGB"; + $mic1 -> setLight("yellow"); + printf("mic1 = %s\n", $mic1 -> brand); printf("mic2 = %s", $mic2 -> brand);