This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by y4nn9
over 9 years

blocage exercice 1

Quand je veux valider mon code il me demande si j’ai bien créer la variable $me merci de votre aide Voici le code :

class Person { }

$me= new Person ();

Answer 5477e20f8c1ccc0d63005e84

0 votes

Permalink

Essayez ceci:

class Person {

public $firstname; public $lastname;

} public function__construct($firstname, $lastname){ $this->firstname = $firstname; $this->lastname = $lastname; } public function presentation(){ return “Bonjour, je suis “. $this->firstname . “ “ . $this->lastname . “. Ravi de vous rencontrer !”; } $me = new Person(“y4nn9”, “Lecode”); echo $me->presentation();

points
Submitted by amaratraore
over 9 years

1 comments

y4nn9 over 9 years

merci ça fonctionne

Answer 547a5e4080ff33b496006fab

0 votes

Permalink

:)

points
Submitted by amaratraore
over 9 years

Answer 54caa15c9113cb41d3000c68

0 votes

Permalink

J'ai fait ça et ca fonctionne:

class Person { } $me = new Person ();

points
Submitted by Nelly
about 9 years