-
-
Save pavanBS/c04a91c76ae910367b264bee14f7b5c4 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 A { | |
public function myage() { | |
return ' age is 80'; | |
} | |
} | |
class B extends A { | |
public function mysonage() { | |
return ' age is 50'; | |
} | |
} | |
class C extends B { | |
public function mygrandsonage() { | |
return 'age is 20'; | |
} | |
public function myHistory() { | |
echo "Class A " .$this->myage(); | |
echo "Class B ".$this-> mysonage(); | |
echo "Class C " . $this->mygrandsonage(); | |
} | |
} | |
$obj = new C(); | |
$obj->myHistory(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment