Rofihimam

Untitled

Feb 12th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2.     interface a
  3.     {
  4.         public function foo();
  5.     }
  6.  
  7.     interface b extends a
  8.     {
  9.         public function baz(Baz $baz);
  10.     }
  11.  
  12.     /**
  13.     This will work
  14.      */
  15.     class c implements b
  16.     {
  17.         public function foo()
  18.         {
  19.         }
  20.  
  21.         public function baz(Baz $baz)
  22.         {
  23.         }
  24.     }
  25.  
  26.     /**
  27.     This will not work and result in a fatal error
  28.      */
  29.     class d implements d
  30.     {
  31.         public function foo()
  32.         {
  33.         }
  34.  
  35.         public function baz(Baz $baz)
  36.         {
  37.         }
  38.     }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment