Advertisement
Guest User

Untitled

a guest
Oct 19th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2.  
  3. class AAA{}
  4. class BBB extends AAA{}
  5.  
  6. class X{
  7.     protected AAA $foo;
  8.     function __construct(AAA $foo){
  9.         $this->foo = $foo;
  10.     }
  11. }
  12.  
  13. class Y extends X{
  14.     protected BBB $foo;
  15.     function __construct(BBB $foo){
  16.         parent::__construct($foo);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement