克隆函数里面的内容的$obj指的是什么
$obj = new Car();$obj->name = $this->name;这两句时干什么的?具体详细是什么意思呢
class Car {
public $name = 'car';
public function __clone() {
$obj = new Car();
$obj->name = $this->name;
}
}
$a = new Car();
$a->name = 'new car';
$b = clone $a;
var_dump($b);