Last active
August 5, 2019 05:16
-
-
Save oojacoboo/82f91b87a3bf136adfbbad616480c492 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Liger implements Animal | |
{ | |
public function getSpecies(): LionTiger | |
{ | |
return new LionTiger(); | |
} | |
} | |
class LionTiger implements Species | |
{ | |
function getName() | |
{ | |
return 'Lion & Tiger'; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Species | |
{ | |
function getName(): string; | |
} | |
interface Animal | |
{ | |
function getSpecies(): Species; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment