Advertisement
Yousuf1791

Book-page-184

Aug 26th, 2022
927
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. interface a{
  4.     public function a1();
  5. }
  6.  
  7. interface b{
  8.     public function b1();
  9. }
  10.  
  11. interface x extends a, b {
  12.     public function x1();
  13. }
  14.  
  15. class SomeClass implements x {
  16.     public function a1(){ //method from interface a
  17.         echo "SomeClass::a1()<br>";
  18.     }
  19.  
  20.     public function b1(){ //method from interface b
  21.         echo "SomeClass::b1()<br>";
  22.     }
  23.  
  24.     public function x1(){ //method from interface b
  25.         echo "SomeClass::x1()<br>";
  26.     }
  27. }
  28.  
  29. $o = new SomeClass();
  30. $o->a1();
  31. $o->b1();
  32. $o->x1();
  33.  
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement