RE: [PHP] Static and Global at the same time!

2006-02-10 Thread Miguel Guirao
Thanks for all your suggestions!! specially to "list"!! Regards, Miguel Guirao -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Viernes, 10 de Febrero de 2006 03:20 p.m. To: Miguel Guirao Cc: PHP List Subject: Re: [PHP] Static and Global at the same time

Re: [PHP] Static and Global at the same time!

2006-02-10 Thread Richard Lynch
On Fri, February 10, 2006 9:07 am, Miguel Guirao wrote: > Can I have a variable that is static and global at the same time > within a > function? > Let's say I have: > > $data = ""; > > function newdata() { > static global $data; > $data [$i] = $newdatatobestored_inthearray; > } No. But if yo

Re: [PHP] Static and Global at the same time!

2006-02-10 Thread Andrei
A static defined variable used in a function will keep it's value each time the function is called, but this function is available only for function's scope. A global defined variable used in a function will keep it's values (as long as this value is not changed in "body" of the script or in

Re: [PHP] Static and Global at the same time!

2006-02-10 Thread Jochem Maas
Andrei wrote: What's the use of global static variables? heh! we need to teach them to test out their own basic questions and assumptions before we move them onto real analysis & deduction. I agree though that a 'global static' looks to be pointless, then again the behaviour in my littl

Re: [PHP] Static and Global at the same time!

2006-02-10 Thread Jochem Maas
Miguel Guirao wrote: Hello list!! my name is not 'list' but I'll let you off this time. Can I have a variable that is static and global at the same time within a function? here is some [linux] command line output that took about 30 seconds to generate, it answers your question. you'll ha

Re: [PHP] Static and Global at the same time!

2006-02-10 Thread Andrei
What's the use of global static variables? Andy Miguel Guirao wrote: Hello list!! Can I have a variable that is static and global at the same time within a function? Let's say I have: $data = ""; function newdata() { static global $data; $data [$i] = $newdatatobestored_

Re: [PHP] Static and Global at the same time!

2006-02-10 Thread Chris Boget
Can I have a variable that is static and global at the same time within a function? Let's say I have: $data = ""; function newdata() { static global $data; $data [$i] = $newdatatobestored_inthearray; } Isn't a global variable static within the function by it's nature of being global? Making

[PHP] Static and Global at the same time!

2006-02-10 Thread Miguel Guirao
Hello list!! Can I have a variable that is static and global at the same time within a function? Let's say I have: $data = ""; function newdata() { static global $data; $data [$i] = $newdatatobestored_inthearray; } Best Regards, --- Miguel Guirao Aguilera Logistica R8