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

2002-01-01 Thread Michael Sims
At 12:08 AM 1/2/2002 -0600, Michael Sims wrote: >At 09:27 AM 1/2/2002 +1100, Ignatius Teo wrote: >>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 > >Not sure...do you recall the reaso

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

2002-01-01 Thread Michael Sims
At 09:27 AM 1/2/2002 +1100, Ignatius Teo wrote: >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 Not sure...do you recall the reasons that were given when you were told that? -- PHP W

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

2002-01-01 Thread Pac mon
passing by reference is in itself a "bad thing"perhaps a necessary >evil. > >All I'm saying is have the "rules" changed since I left Uni? > > > >Ignatius > > > >- Original Message - >From: "Pac mon" <[EMAIL

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

2002-01-01 Thread Ignatius Teo
<[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 02, 2002 2:30 PM Subject: Re: Fw: [PHP-WIN] Passing by reference... > Some teachers will say this just because they think students are dumb. The > reasoning behind it is that 'if we teach them to pass by ref

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

2002-01-01 Thread Pac mon
ot;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" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]>

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

2002-01-01 Thread Ignatius Teo
t; 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 b

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

2001-12-31 Thread Anthony Ritter
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 sa

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

2001-12-31 Thread Michael Sims
At 08:51 PM 12/31/2001 -0600, Anthony Ritter wrote: >... >function tax (&$Salary) > { > $Salary= $Salary - (($Salary/100)*20); > return $Salary; > } >$Salary=2500; >echo (tax($Salary)); // This displays $2000 >echo $Salary; // This also di

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

2001-12-31 Thread Anthony Ritter
Michael, The following is the code taken line for line from Wrox - Beginning PHP - on page 204. ... The question really was about the *ampersand* in the argument line which supposedly changes the value of the va

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

2001-12-31 Thread Michael Sims
At 07:37 PM 12/31/2001 -0600, Anthony Ritter wrote: >.. >function tax (&$Salary) > { > $Salary= $Salary - (($Salary/100)*20); > return $Salary; > } >$Salary=2500; >echo $Salary; >?> >.. > >The result in the textbook is 2000

[PHP-WIN] Passing by reference...

2001-12-31 Thread Anthony Ritter
I'm using Windows98 / Apache and looking at a php snippet from Wrox on page 204. It goes like this: .. .. The result in the textbook is 2000 but I'm getting 2500. It says that to pass an argument by reference you *add* an ampe