求教,自己实在是找不出了……
<?php
class Car {
public $speed = 10;
//在这里使用重载实现speedDown方法
public function _call($name,$args){
if ($name =='speedDown'){
$this->speed -=10;
}
}
}
$car = new Car();
$car->speedDown(); //调用不存在的speedDown方法
echo $car->speed;
请问哪出错了?
<?php
class Car {
public $speed = 10;
//在这里使用重载实现speedDown方法
public function _call($name,$args){
if ($name =='speedDown'){
$this->speed -=10;
}
}
}
$car = new Car();
$car->speedDown(); //调用不存在的speedDown方法
echo $car->speed;
请问哪出错了?
2016-08-01
举报