Created
January 19, 2019 03:31
-
-
Save neloy-ahmed/9188234ea4d0ef4025a39a4c1b08271d 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 | |
abstract class World{ | |
abstract protected function draw_map($country_name); | |
abstract protected function draw_flag($country_name); | |
public function show_info(){ | |
print "This is an abstract class for World"; | |
} | |
} | |
class Country extends World{ | |
protected function draw_map($country_name){ | |
print "Map of $country_name <br/>"; | |
} | |
public function draw_flag($country_name){ | |
print "Flag of $country_name <br/>"; | |
} | |
} | |
$bangladesh = new Country(); | |
$bangladesh->draw_flag("Bangladesh"); | |
$bangladesh->show_info(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment