Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- interface Vehicle {
- public function info ();
- }
- interface Car extends Vehicle {
- public function drive ();
- }
- interface Plane extends Vehicle {
- public function fly ();
- }
- class BMW implements Car {
- public function drive(){
- echo 'Brrrrm...';
- }
- public function info () {
- echo '<h1>About BMW</h1>';
- }
- }
- class SuperCar implements Car, Plane{
- public function info () {
- echo '<p>Short info</p>';
- }
- public function drive () {
- echo '<p>Brrrrmmmm...</p>';
- }
- public function fly () {
- echo '<p>Ready to fly!</p>';
- }
- }
- $sc = new SuperCar();
- $sc->info();
- $sc->drive();
- $sc->fly();
Advertisement
Add Comment
Please, Sign In to add comment