gilsonfilho

Untitled

Jul 20th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. <?php
  2.  
  3. class Animal {
  4.     public function Andar() {
  5.         echo "o animal andou";
  6.  
  7.     }
  8.     public function Correr() {
  9.         echo "o animal Correu";
  10.  
  11.     }
  12.  
  13. }
  14. class Cavalo extends Animal{
  15.     public function Andar(){
  16.         $this->Correr();
  17.     }
  18. }
  19. $animal = new Cavalo();
  20. $animal->Andar();
Advertisement
Add Comment
Please, Sign In to add comment