#32264 [Opn->Fbk]: refcount is not updated
| From: | sniper@php.net | Date: | Mon, 14 Mar 2005 00:14:02 +0000 |
| Subject: | #32264 [Opn->Fbk]: refcount is not updated | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76922@lists.php.net to get a copy of this message | ||
ID: 32264
Updated by: sniper@php.net
Reported By: tangi dot maury at wanadoo dot fr
-Status: Open
+Status: Feedback
Bug Type: Class/Object related
Operating System: windows 2000
PHP Version: 4.3.9
New Comment:
Fatal error: Call to undefined function: pars_infoo()...
What's that pars_infoo() function supposed to be?
And please use ENGLISH in your test script. (I don't understand
french)
Previous Comments:
------------------------------------------------------------------------
[2005-03-10 16:27:48] tangi dot maury at wanadoo dot fr
Description:
------------
I'd like use '=null' on variables who points to object.
but the refcount is not updated in this case.
It is updated only after unset on variable.
is it a real pb ?
By,
Reproduce code:
---------------
a small test ->
class a{
}
class b extends a{
}
class t{
var $r = null;
var $pr = null;
function test(){
$this->r = &new b();
echo "nb Ref r apres new = " . pars_infoo($this->r);
$this->pr = &$this->r;
echo "<br/>nb Ref pr apres pr = " . pars_infoo($this->r);
echo "<br/>nb Ref r apres pr = " . pars_infoo($this->pr);
//unset($this->pr); OK
$this->pr = null;
echo "<br/> nb Ref r apres unset " . pars_infoo($this->r);
}
}
$b= new t();
$b->test();
source for pars_infoo(Zend)
if ((*pO)->is_ref)
ret = strUWFormat(ret, nPos, &nPos, "nb référence = %hd",
(*pO)->refcount);
Expected result:
----------------
if i make unset it's ok
->
nb Ref r apres unset nb référence = 2 <- ok
Actual result:
--------------
->
nb Ref r apres new = nb référence = 2
nb Ref pr apres pr = nb référence = 3
nb Ref r apres pr = nb référence = 3
nb Ref r apres unset nb référence = 3 <- wrong
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32264&edit=1