Пример #1
0
$cars[0]->move(30);
//$cars[1]->km = $cars[1]->km + 30; 
$cars[1]->move(20);
echo "<pre>";
print_r($cars);
 * 
 * */
// public / private / protected
require_once "car.class.php";
require_once "truck.class.php";
require_once "plane.class.php";
$car = new Car(20, 'red', 5, 2);
$car->unloadPass(1);
$truck = new Truck(50, 'yello', 2200);
$truck->load(10);
$truck->unload(1000);
$vehicle = new Vehicle(20, 'blue');
$plane = new Plane(120, 'grey', 'AIRsoft', 1000, 8000);
$plane->drop(200);
echo "<pre>";
print_r($car);
print_r($truck);
print_r($vehicle);
$vehicle = new Vehicle(20, 'red');
$vehicle->move(20);
$vehicle->move(30);
$vehicle->move(15);
echo "<pre>";
print_r($vehicle);
$carPass = new Car(14, 'orange', 3, 3);
$carPass->loadPass(3);
Пример #2
0
//$cars[1]->km = $cars[1]->km + 30; 
$cars[1]->move(20);
echo "<pre>";
print_r($cars);
 * 
 * */
// public / private / protected
require_once "car.class.php";
require_once "truck.class.php";
require_once "plane.class.php";
$car = new Car(20, 'red', 5);
$car->load(3);
$car->unload(1);
$truck = new Truck(50, 'yello', 2200);
$truck->load(2);
$truck->unload(5);
$vehicle = new Vehicle(20, 'blue');
$plane = new Plane(3000, "white", 200, 5000, "Emirates", 40);
$plane->attack(70);
echo "<pre>";
print_r($car);
print_r($truck);
print_r($vehicle);
print_r($plane);
if ($plane->seats >= 200) {
    echo "No Seats Available";
}
$vehicle = new Vehicle(20, 'red');
$vehicle->move(20);
$vehicle->move(30);
$vehicle->move(15);