Tr: [PHP] What does &var mean ?

From: Date: Thu, 22 Nov 2001 16:44:44 +0000
Subject: Tr: [PHP] What does &var mean ?
Groups: php.general 
Request: Send a blank email to php-general+get-75522@lists.php.net to get a copy of this message
----- Original Message ----- From: Nayco_IUT Laroche <nayco@laroche.univ-nantes.fr> To: Girish Nath <girishn@btinternet.com> Sent: Thursday, November 22, 2001 4:59 PM Subject: Re: [PHP] What does &var mean ? > This is a reference to the variable, that means that it extends the scope of > this variable into the function, ie, you can modify this variable inside the > function ... OK, OK, my english is bad so maybe you didn't understand > anything .... Well, I tried ;~) !!! > In fact, &var is THE ADDRESS of var .... > > ----- Original Message ----- > From: Girish Nath <girishn@btinternet.com> > To: <php-general@lists.php.net> > Sent: Thursday, November 22, 2001 4:43 PM > Subject: [PHP] What does &var mean ? > > > > Hi > > > > I've been looking at some classes an have come across this notation for > > example : > > > > function remove(&$productid) { > > /* this function will remove a given product from the cart */ > > if (isset($productid)) { > > unset($this->items[$productid]); > > } > > } > > > > > > What does the "&" (ampersand) before the variable name mean ? > > > > Thanks > > > > > > Girish > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > >

« previous php.general (#75522) next »