Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- abstract class User {
- public $name;
- public $last_name;
- /**
- * @param $name
- * @param $last_name
- * @return mixed
- */
- abstract function print_full(); // required
- }
- class Mod extends User{
- function print_full () {
- echo $this->last_name.' '.$this->name;
- }
- }
- $mod = new Mod();
- $mod->name = 'Htn';
- $mod->last_name = 'Pro';
- echo '<pre>';
- var_dump($mod);
- echo '</pre>';
- $mod->print_full();
Advertisement
Add Comment
Please, Sign In to add comment