Created
August 6, 2015 22:45
-
-
Save alanwillms/f169a37083919fca2af8 to your computer and use it in GitHub Desktop.
Liskov 2: PHP constructor overwriting
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 ClasseBase | |
| { | |
| public function __construct($a) { } // um parâmetro | |
| } | |
| class SubClasse extends ClasseBase | |
| { | |
| public function __construct($a, $b) { } // dois parâmetros | |
| } | |
| // Sucesso! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment