From f7638c868c02f505a72a8e1c296cb8277b8f7bd1 Mon Sep 17 00:00:00 2001 From: psfroad Date: Mon, 29 Sep 2025 11:37:23 +0200 Subject: [PATCH] second commit --- Etudiant.php | 4 ++++ script1.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Etudiant.php b/Etudiant.php index 7826116..9086cf7 100644 --- a/Etudiant.php +++ b/Etudiant.php @@ -7,4 +7,8 @@ class Etudiant{ public function setNom($n){ $this->nom = $n; } + + public function getNom(){ + return $this->nom; + } } \ No newline at end of file diff --git a/script1.php b/script1.php index 5b9107c..164ca1f 100644 --- a/script1.php +++ b/script1.php @@ -8,4 +8,6 @@ traitementPrive(); $etu1 = new Etudiant(); -$etu1->nom ="Durand"; +$etu1->setNom("Durand"); + +echo "Nom de l'étudiant :".$etu1->getNom();