基础题:对象引用问题?
<?php<br /> $global_obj=null;<br /> <br /> class Demo{<br /> var $my_val;<br /> public function __construct(){<br /> global $global_obj;<br /> $global_obj=&$this;<br /> }<br /> }<br /> <br /> $p=new Demo();<br /> <br /> $p->my_val=5;<br /> <br /> global $global_obj;<br /> <br /> $global_obj->my_val=10;<br /> <br /> echo $p->my_val; //输出5<br /> <br /> var_dump($p===$global_obj); //返回false<br /> ?>