Fw: [PHP-WIN] Passing by reference...

From: Date: Tue, 01 Jan 2002 22:27:45 +0000
Subject: Fw: [PHP-WIN] Passing by reference...
Groups: php.windows 
Request: Send a blank email to php-windows+get-11257@lists.php.net to get a copy of this message
Isn't passing by reference a "no-no" is terms of good programming? At least that's what I was told when I studied programming about 12 years ago? Ignatius ----- Original Message ----- From: "Anthony Ritter" <tony@gonefishingguideservice.com> To: <php-windows@lists.php.net> Sent: Tuesday, January 01, 2002 2:40 PM Subject: Re: [PHP-WIN] Passing by reference... > Michael Sims wrote in message: > > Yes, that is true. The "tax" function has the ampersand in the argument > > list, which means that any variable that you send to it gets passed by > > reference. This means that any changes to that variable that occur inside > > the function will actually affect the same variable that is in the scope > of > > the main script. Without the ampersand, the function will only modify > it's > > own local copy of the variable and leave the one in the main script > > unaltered. If you remove the ampersand from the above script and re-run > > it, then the output of the first echo statement should not change, but the > > second one will change to 2500 since the function will no longer be > > altering the variable in the main script. > > > > http://www.php.net/manual/en/language.references.pass.php > > > > Sorry if I'm not understanding your question... > .................................... > > Thanks for the reply Michael. You've answered my question. > > A happy and healthy new year to you and yours. > Tony Ritter > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.windows (#11257) next »