Advertisement
Darksider3

OOP Koncept with PHP 0.1alpha

Nov 5th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2. abstract class Tier
  3. {
  4.     protected $Name;
  5.     protected $Laut;
  6.     public function gibNameAus()
  7.     {
  8.         echo $this->Name;
  9.     }
  10.     public function fibLaut()
  11.     {
  12.         echo $this->Laut;
  13.     }
  14. }
  15.  
  16. class Hund extends Tier {
  17.     public function __construct()
  18.     {
  19.         $this->Laut = "Wuff";
  20.         $this->Name = "Bello/HUND";
  21.         $this->gibNameAus();
  22.         echo "\n";
  23.         $this->fibLaut();
  24.     }
  25. }
  26. $obj = new Hund;
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement