PHP last quiz | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

PHP last quiz

Can anybody please help me with the answers, 1st one is class but cant Find the other 3? fill in the blanks to declare a class singer having a display method that outputs the name. than, create an object of the class and call the display method? ______singer{ Public $name = “Ann”; Public funtion display(){ Echo_______->name; } } $s =____singer(); $s___display();

1st May 2019, 8:54 PM
Dimitri Cadau
Dimitri Cadau - avatar
7 Answers
+ 3
Singer { public $name = "Ann"; public function display() { echo ->name; } } $s = Singer(); $s display();
11th Jul 2021, 12:13 PM
MURODJON ABDUGAPIROV
MURODJON  ABDUGAPIROV - avatar
+ 1
interface MusicianInterface { public function play(); } class Guitarist implements MusicianInterface { public function play() { echo "La La La"; } } $obj = new Guitarist(); $obj->play();
17th Mar 2021, 9:53 PM
Mustapha Ait Ou-saleh
Mustapha Ait Ou-saleh - avatar
0
<?php class singer{ public $name = "Ann"; public function display(){ echo $this->name; } } $s = new singer(); $s->display();
13th May 2019, 12:33 AM
Jônatas Araripe
Jônatas Araripe - avatar
0
thanks mate
13th May 2019, 12:54 AM
Dimitri Cadau
Dimitri Cadau - avatar
0
Answer is class $this new ->
5th Sep 2019, 5:07 PM
Aftab Ashraf
Aftab Ashraf - avatar
0
27th Jan 2020, 1:15 PM
Chidinma Akuegbu
Chidinma Akuegbu - avatar
- 1
<?php class singer{ public $name = "Ann"; public function display(){ echo $this->name; } } $s = new singer(); $s->display();
9th Oct 2019, 6:50 AM
Gisa Kaze Fredson
Gisa Kaze Fredson - avatar