复制代码 代码如下:
$a = array (
'str' => 1,
'child' => 2
);
$b = $a;
$b['child'] = $a;
$b['child']['str'] = 2;
echo $b['str'];
$b = null;
echo $a['str'];
复制代码 代码如下:
class A
{
public $str = '';
public $child;
}
$a = new A();
$b = $a;
$a->str = 1;
$a->child = 2;
$b->child = $a;
$b->child->str = 2;
echo $b->str;
$b = null;
echo $a->str;
新闻热点
疑难解答