Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- abstract class Person {
- abstract public function getName();
- public function getIntroduction() {
- return sprintf(
- 'My name is %s',
- $this->getName()
- );
- }
- }
- class Joaquin extends Person {
- public function getName() {
- return 'Joaquin';
- }
- }
- $joaquin = new Joaquin();
- print $joaquin->getIntroduction();
- // This prints "My name is Joaquin"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement