Created
July 26, 2021 01:36
-
-
Save EricMcWinNer/0221294124185c3164c19f81ef377718 to your computer and use it in GitHub Desktop.
This file contains 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 Animal { | |
public static function makeSound(){ | |
echo "Animal"; | |
} | |
public static function vocalize() { | |
echo static::makeSound(); | |
} | |
} | |
class Dog extends Animal { | |
public static function makeSound() { | |
echo "Dog"; | |
} | |
} | |
Dog::vocalize(); // Animal | |
class Husky extends Dog { | |
public static function makeSound() { | |
echo "Husky"; | |
} | |
} | |
Husky::vocalize(); // Husky |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment