Advertisement
Yousuf1791

Book-page-137

Aug 3rd, 2022
952
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. <?php
  2.  
  3. class ParentClass{
  4.     public function show($value){
  5.         echo "Parent show({$value}) <br>";
  6.     }
  7. }
  8.  
  9. class ChildClass{
  10.     public function show($value){
  11.         echo "Child show({$value}) <br>";
  12.     }
  13. }
  14.  
  15. $parent = new ParentClass();
  16. $parent->show(100);
  17.  
  18.  
  19. $child = new ChildClass();
  20. $child->show(50);
  21.  
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement