Created
December 1, 2019 11:16
-
-
Save jenovateurs/e174cd85c7a318f014e5f712bffa8bee to your computer and use it in GitHub Desktop.
Nouveauté PHP 7.4 - Typage du retour covariant
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 Voiture {} | |
| class Sport extends Voiture {} | |
| class Consommateur { | |
| public function achat(): Voiture {} | |
| } | |
| class Sportif extends Consommateur { | |
| public function achat(): Sport {} | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment