Advertisement
hamjoricantiq

Untitled

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