|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-04-21 01:51 UTC] zhong_hongye at citiz dot net
1.I can't get a reference of object's member :
class t{
var $var1;
var $var2;
};
$a1 = new t;
$a1->var2='123';
$p1 = &($a1->var2);
//php report error
$p2 = &$a1->var2;
//$p2 get reference of $a1
2.variables are releaseed uncorrect.
class b{
var $y;
};
class a{
var $x;
function getx(){
$v = new b;
$x=&$v;
}
};
$n = new a;
$n->getx();
//$n->x seems not good.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 04:00:01 2025 UTC |
1.I can't get a reference of object's member : class t{ var $var1; var $var2; }; $a1 = new t; $a1->var2='123'; $p1 = &($a1->var2); //php report error $p2 = &$a1->var2; //$p2 get reference of $a1 2.variables are releaseed uncorrect. class b{ var $y; }; class a{ var $x; function getx(){ $v = new b; $this->x=&$v; } }; $n = new a; $n->getx(); //$n->x seems not good.