Re: [PHP-DEV] Re: Confusing pointers in PHP 4 and 5

2004-06-10 Thread Derick Rethans
Hey, put this in thedocs somewhere? regards, Derick On Wed, 9 Jun 2004, Sara Golemon wrote: > That's true. What I left out of my explanation (in order to keep it simple) > is that when you "copy" a variable, a new label is created to point to the > same zval, and the zval's refcount is incrme

Re: [PHP-DEV] Re: Confusing pointers in PHP 4 and 5

2004-06-09 Thread Andi Gutmans
In general, if you don't mean for it to be a reference semantically, you are best off not using references at all. PHP will do the right thing. Andi At 10:32 AM 6/9/2004 +0200, Bert Slagter wrote: Derick Rethans wrote: On Wed, 9 Jun 2004, Stephan Schmidt wrote: Yes, that is correct. No, it is not

Re: [PHP-DEV] Re: Confusing pointers in PHP 4 and 5

2004-06-09 Thread Bert Slagter
Derick Rethans wrote: On Wed, 9 Jun 2004, Stephan Schmidt wrote: Yes, that is correct. No, it is not. 'copying' a variable copies the structure to contain the variable, but not the data, but does NOT make a reference as that's a different concept. You are right that the data associated with a vari

RE: [PHP-DEV] Re: Confusing pointers in PHP 4 and 5

2004-06-09 Thread Derick Rethans
On Wed, 9 Jun 2004, Stephan Schmidt wrote: > Hi, > > > I think, and I could be completely wrong, that copying a > > variable actually > > creates a reference. The data is only copied when the > > variable referenced is > > modified. > Yes, that is correct. No, it is not. 'copying' a variable copi

RE: [PHP-DEV] Re: Confusing pointers in PHP 4 and 5

2004-06-09 Thread Stephan Schmidt
Hi, > I think, and I could be completely wrong, that copying a > variable actually > creates a reference. The data is only copied when the > variable referenced is > modified. Yes, that is correct. Stephan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://w