ericek111

What

Feb 27th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. class Alpha {}
  2. class Bravo extends Alpha {}
  3.  
  4. abstract class Dog {
  5.     abstract function woof(): Alpha;
  6. }
  7. class Cat extends Dog {
  8.     public function woof(): Bravo {
  9.         return new Bravo();
  10.     }
  11. }
  12.  
  13. // Declaration of Cat::woof(): Bravo must be compatible with Dog::woof(): Alpha
Advertisement
Add Comment
Please, Sign In to add comment