Created
November 4, 2015 18:23
-
-
Save VictorFursa/3ca4fbfb5b92b867d8cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/html; charset=utf-8'); | |
class Cars{ | |
public $mark;// марка | |
public $type; // тип | |
public $tonnage; // тонаж | |
} | |
class Truck extends Cars { | |
public function __construct(){ | |
echo $this->mark = "MAN "; | |
echo $this->type = "Грузовик "; | |
echo $this->tonnage = "20 тон"; | |
} | |
} | |
class Bus extends Cars{ | |
public function GetMark() | |
{ | |
echo $this->mark = "RENO"; | |
echo $this->type = " Автобус " ; | |
echo $this->tonnage = "50 мест"; | |
} | |
} | |
$truck = new Truck(); | |
echo "<br>"; | |
$bus = new Bus(); | |
$bus->GetMark(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment