Page 1 of 1

what does '=&' means?

Posted: Mon Jul 07, 2008 4:38 pm
by tri9999
Hi,

I'm new to php. I came across php codes with something like this:

$this->th->ss =& $this->ss;

What does the operator '=&' mean??? Is it pointer dereference??

I've never encounter '=&' in any of the tutorials I've read. So can someone explain to me what it is and give an example?


Thanks for helping,

-Tri

Re: what does '=&' means?

Posted: Mon Jul 07, 2008 5:04 pm
by Eran
it means pass by reference instead of by value. In PHP5 objects are passed by reference by default, and everything else is passed by value. Also, run-time pass-by-reference will raise a warning on PHP5 as its considered bad practice (causes hard to debug bugs).