本文整理汇总了PHP中Vehicle::move方法的典型用法代码示例。如果您正苦于以下问题:PHP Vehicle::move方法的具体用法?PHP Vehicle::move怎么用?PHP Vehicle::move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle::move方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: move
public function move($distance)
{
$result = parent::move($distance);
if ($result == false) {
echo 'Nema nafta! Vsichki da slizat.';
$this->passengers = 0;
}
}
示例2: Car
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);
echo "<pre>";
print_r($carPass);
print_r($plane);