Skip to content

Instantly share code, notes, and snippets.

@EricMcWinNer
Created July 26, 2021 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricMcWinNer/0221294124185c3164c19f81ef377718 to your computer and use it in GitHub Desktop.
Save EricMcWinNer/0221294124185c3164c19f81ef377718 to your computer and use it in GitHub Desktop.
<?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