Advertisement
Geicy

Untitled

Jul 30th, 2021
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. <?php
  2.  
  3. class Pessoa{
  4.     const nome = "Geicy";
  5.  
  6.     public function exibirNome(){
  7.         echo self::nome;
  8.     }
  9. }
  10.  
  11. class Geicy extends Pessoa{
  12.     const nome = "Rodrigues";
  13.  
  14.     public function exibirNome(){
  15.         echo parent::nome;
  16.     }
  17.  
  18. }
  19.  
  20. $geicy = new Geicy();
  21. $geicy->exibirNome();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement