<?php
class demo{
public $name='xiatao';
}
$A = new demo();
$B=$A;
$C=clone $A;
$D=new demo();
$A->name='caibaihua';
echo '对象引用:'.$A->name.'--'.$B->name;
echo '<hr>';
echo '克隆引用:'.$A->name.'--'.$C->name;
echo '<hr>';
echo '创建对象:'.$A->name.'--'.$D->name;
echo '<hr>';
echo '克隆对象的类是:'.get_class($C);
?>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!