Last active
November 4, 2015 20:52
-
-
Save VictorFursa/769c4aba7f63a30c4453 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{ | |
protected $mark;// марка | |
public $type; // тип | |
public $tonnage; // тонаж | |
protected $places; // места | |
public function setMark($mark,$places){ | |
echo $mark . " " . $places . " мест"; | |
} | |
} | |
class Truck extends Cars { | |
public function __construct(){ | |
echo $this->mark = "MAN "; | |
echo $this->type = "Грузовик "; | |
echo $this->tonnage = 20 ." тон"; | |
} | |
} | |
class Bus extends Cars{ | |
public function __construct($mark,$places){ | |
echo $mark . " " . $places . " мест"; | |
} | |
public function GetMark() | |
{ | |
echo $this->mark = "RENO"; | |
echo $this->type = " Автобус " ; | |
} | |
} | |
$truck = new Truck(); | |
echo "<br>"; | |
echo "<br>"; | |
$bus = new Bus("Газель",20); | |
echo "<br>";echo "<br>"; | |
$bus->GetMark(); | |
echo "<br>"; | |
$bus->setMark("Volvo",70); | |
echo "<br>"; | |
$bus->setMark("Газель",100500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment