ID: 32264
User updated by: tangi dot maury at wanadoo dot fr
Reported By: tangi dot maury at wanadoo dot fr
Status: Bogus
Bug Type: Class/Object related
Operating System: windows 2000
PHP Version: 4.3.9
New Comment:
Whith debug_zval_dump
i have the result 1 ->
object(b)(0) refcount(1){ }
It's alays the same refcount, even i refer the object
more than once.
I think it's a wrong test.
Previous Comments:
------------------------------------------------------------------------
[2005-03-14 21:49:22] [EMAIL PROTECTED]
Try replacing "pars_infoo" with "debug_zval_dump" as it will give
reliable results.
------------------------------------------------------------------------
[2005-03-14 08:49:16] tangi dot maury at wanadoo dot fr
I write it in Zend Language and compile with vc++ 6.
static const unsigned char arg_ref[] = {1, BYREF_FORCE};
PHP_FE(pars_infoo, (unsigned char *) arg_ref)
PHP_FUNCTION(pars_infoo){
pval ** pO = NULL;
char ret[50];
ret[0] = 0;
if (zend_get_parameters_ex(1, &pO) == FAILURE) return;
if ((*pO)->is_ref)
sprintf(ret, "ref count = %hd", (*pO)->refcount);
RETVAL_STRING(ret, 1);
return;
}
------------------------------------------------------------------------
[2005-03-14 01:14:01] [EMAIL PROTECTED]
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)
------------------------------------------------------------------------
[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