nom = $nom; $this->prenom = $prenom; $this->age = $age; } public function getNom() { return $this->nom; } public function getPrenom() { return $this->prenom; } public function getAge() { return $this->age; } public function setNom($nom) { $this->nom = $nom; } public function setPrenom($prenom) { $this->prenom = $prenom; } public function setAge($age) { if ($age > 0) { $this->age = $age; } else { throw new Exception("L'âge doit être un nombre positif."); } } public function afficherInfo() { return "Nom: " . $this->nom . ", Prénom: " . $this->prenom . ", Âge: " . $this->age; } }