Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php
  2. class Personne{
  3.  
  4. private $nom;
  5. private $prenom;
  6. private $age;
  7.  
  8. function __construct(String $nom,String $prenom,int $age){
  9. $this->nom=$nom;
  10. $this->prenom=$prenom;
  11. $this->age=$age;
  12. }
  13.  
  14. function set_prenom(String $prenom){
  15. $this->prenom = $prenom;
  16. }
  17.  
  18. function set_nom(String $nom){
  19. $this->nom = $nom;
  20. }
  21.  
  22. function set_age(int $age){
  23. $this->age = $age;
  24. }
  25.  
  26. function get_prenom():String{
  27. $echo $this->prenom;
  28. }
  29.  
  30. function get_nom():String{
  31. $echo $this->nom;
  32. }
  33.  
  34. function get_age():int{
  35. $echo $this->age;
  36. }
  37.  
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement