php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4214 reference variable problem
Submitted: 2000-04-21 01:51 UTC Modified: 2000-06-01 19:34 UTC
From: zhong_hongye at citiz dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Release Candidate 1 OS: Win2k iis&apache
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zhong_hongye at citiz dot net
New email:
PHP Version: OS:

 

 [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.







Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-04-21 02:02 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;
        $this->x=&$v;
    }
};

$n = new a;
$n->getx();

//$n->x seems not good.







 [2000-06-01 19:34 UTC] stas at cvs dot php dot net
1. Remove parentheses. $p1 = &($a1->var2) won't work, $p1 = &$a1->var2 would.

2. it seems to be OK. Does it still happen?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 16:01:27 2024 UTC