本文整理汇总了PHP中Car::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Car::__construct方法的具体用法?PHP Car::__construct怎么用?PHP Car::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Car
的用法示例。
在下文中一共展示了Car::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($a, $b, $num, $perKm, $mon, $se)
{
$this->number = $num;
$this->price_per_km = $perKm;
$this->money = $mon;
parent::__construct($a, $b, $se);
}
示例2: __construct
public function __construct()
{
parent::__construct();
echo "i am a SUV";
}
示例3: __construct
public function __construct($price, $maxSpeed, $color)
{
parent::__construct($price, $maxSpeed, $color);
$this->passangers = array();
}
示例4: __construct
public function __construct($price, $maxSpeed, $color)
{
parent::__construct($price, $maxSpeed, $color);
$tax = $color == "red" ? $this->price * (self::TAX + 0.1) : $this->price * self::TAX;
$this->price = $this->price + $tax;
}
示例5:
function __construct($color = "", $mfg = "", $model = "", $type = "", $cc = 3500, $price = 155555555)
{
parent::__construct($color, $mfg, $model, $type, $cc);
$this->price = $price;
$this->cc = $cc;
}