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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Mon Jun 24 12:01:31 2024 UTC