arrays - PHP: Data loss when pass an object -


i have class array of socket

class {     public $clients = array(); } 

and class b extends thread in constructor pass class .

class b extends thread {     private $a;     public function __construct($a)     {         $this->a = $a;     } } 

next, if add print_r instruction,

$this->a = $a; print_r($this->a); print_r($a); 

i have output $this->a

a object (     [clients] => array     (         [0]=> 0     ) ) 

this output $a.

a object (     [clients] => array     (         [0]=> resource id #n     ) ) 

why lose socket data?

i have tried pass &$a in construct.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -