Skip to content
Snippets Groups Projects
Commit eed2a056 authored by Raghav's avatar Raghav
Browse files

Method calling using keyword

parent bc27597a
No related branches found
No related tags found
No related merge requests found
...@@ -8,4 +8,10 @@ class Mic ...@@ -8,4 +8,10 @@ class Mic
public $model; public $model;
public $light; public $light;
public $price; public $price;
// Creating methods..
public function setLight($light){
print($light);
print($this -> light);
}
} }
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
$mic1->brand = "Toyota"; $mic1->brand = "Toyota";
$mic2 -> brand = "Hyundai"; $mic2 -> brand = "Hyundai";
$mic1 -> light = "RGB";
$mic1 -> setLight("yellow");
printf("mic1 = %s\n", $mic1 -> brand); printf("mic1 = %s\n", $mic1 -> brand);
printf("mic2 = %s", $mic2 -> brand); printf("mic2 = %s", $mic2 -> brand);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment