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
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
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
<[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
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]>
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
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
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
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
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
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
11 matches
Mail list logo