Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Alpha {}
- class Bravo extends Alpha {}
- abstract class Dog {
- abstract function woof(): Alpha;
- }
- class Cat extends Dog {
- public function woof(): Bravo {
- return new Bravo();
- }
- }
- // Declaration of Cat::woof(): Bravo must be compatible with Dog::woof(): Alpha
Advertisement
Add Comment
Please, Sign In to add comment