RE: [PHP] scope problem

2004-03-05 Thread Larry Brown
List Subject: Re: [PHP] scope problem Hello Larry, Friday, March 5, 2004, 4:01:39 PM, you wrote: LB> This gives values something to the tune of... LB> 200 LB> 400 LB> 700 LB> 100 Hard to say with so little code, but... Your first where loop is probably running twice, i.e. res

Re: [PHP] scope problem

2004-03-05 Thread Richard Davey
Hello Larry, Friday, March 5, 2004, 4:01:39 PM, you wrote: LB> This gives values something to the tune of... LB> 200 LB> 400 LB> 700 LB> 100 Hard to say with so little code, but... Your first where loop is probably running twice, i.e. resetting variable back to 100 after the 2nd (internal) wh

[PHP] scope problem

2004-03-05 Thread Larry Brown
Apparently I'm having some kind of meltdown here. Can anyone explain the logic behind why the following variable has the original value and how I can pull/push the value to access it at the end? while loop { $variable = 100; while loop { switch($othervar)

Re: [PHP] Scope problem in while loop

2002-03-11 Thread Randall Perry
Whoops, you're right. Classic 'C' mistake using = instead of ==. Never mind :( > On Mon, 2002-03-11 at 18:51, Randall Perry wrote: >> According to the PHP 4 docs all variables are global unless within a >> function. I've got the following test code which should output 2, but >> outputs 1. The whi

RE: [PHP] Scope problem in while loop

2002-03-11 Thread Demitrious S. Kelly
rch 11, 2002 6:52 PM To: [EMAIL PROTECTED] Subject: [PHP] Scope problem in while loop According to the PHP 4 docs all variables are global unless within a function. I've got the following test code which should output 2, but outputs 1. The while loop creates it's own class object (w

Re: [PHP] Scope problem in while loop

2002-03-11 Thread Lars Torben Wilson
On Mon, 2002-03-11 at 18:51, Randall Perry wrote: > According to the PHP 4 docs all variables are global unless within a > function. I've got the following test code which should output 2, but > outputs 1. The while loop creates it's own class object (which seems strange > since it isn't explicitl

[PHP] Scope problem in while loop

2002-03-11 Thread Randall Perry
According to the PHP 4 docs all variables are global unless within a function. I've got the following test code which should output 2, but outputs 1. The while loop creates it's own class object (which seems strange since it isn't explicitly instantiated by my code; I would think it would cause er