class Demo{
}
$demo = new Demo();
1.对象的赋值是浅拷贝,共享同一个内存地址 $demoCopy1 = $demo;
2.对象的复制是深拷贝,互不影响 $demoCopy2 = clone $demo;
class Demo{
}
$demo = new Demo();
1.对象的赋值是浅拷贝,共享同一个内存地址 $demoCopy1 = $demo;
2.对象的复制是深拷贝,互不影响 $demoCopy2 = clone $demo;
转载于:https://www.cnblogs.com/yuntianhe/p/7729592.html