ID:               32264
 User updated by:  tangi dot maury at wanadoo dot fr
 Reported By:      tangi dot maury at wanadoo dot fr
-Status:           Feedback
+Status:           Open
 Bug Type:         Class/Object related
 Operating System: windows 2000
 PHP Version:      4.3.9
 New Comment:

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;
}


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to