Advertisement
Yousuf1791

Book-page-165

Aug 7th, 2022
801
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <?php
  2.  
  3. class Storage {
  4.     protected $ip;
  5. }
  6.  
  7. abstract class Database extends Storage{
  8.     abstract public function connect();
  9. }
  10.  
  11. abstract class FileSystem extends Storage {
  12.     abstract public function mount();
  13. }
  14.  
  15. class MySQL extends Database{
  16.     public function connect(){
  17.         echo "<br>Connect to MySQL";
  18.     }
  19. }
  20.  
  21. class TapeDrive extends FileSystem{
  22.     public function mount(){
  23.         echo "<br>Mount to TapeDrive";
  24.     }
  25. }
  26.  
  27. $mysql = new MySQL();
  28. $mysql->connect();
  29.  
  30. $tape = new TapeDrive();
  31. $tape->mount();
  32.  
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement