Skip to content

Instantly share code, notes, and snippets.

@VictorFursa
Created November 4, 2015 18:23
Show Gist options
  • Save VictorFursa/3ca4fbfb5b92b867d8cd to your computer and use it in GitHub Desktop.
Save VictorFursa/3ca4fbfb5b92b867d8cd to your computer and use it in GitHub Desktop.
<?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