Re: Static and Global at the same time!
| From: | Jochem Maas | Date: | Fri, 10 Feb 2006 15:31:53 +0000 |
| Subject: | Re: Static and Global at the same time! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230213@lists.php.net to get a copy of this message | ||
Andrei wrote:
<humor small_print="no accounting for taste"> heh! we need to teach them to test out their own basic questions and assumptions before we move them onto real analysis & deduction. </humor> I agree though that a 'global static' looks to be pointless, then again the behaviour in my little test wasn't what I expected to see exactly: namely that you can set a single variable to static and global one at a time [inside a function] but that the order in which you do it affects how the variable 'works'. - see my other post in this threadWhat's the use of global static variables?
AndyMiguel 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_inthearray; } Best Regards, ----------------------- Miguel Guirao Aguilera Logistica R8 TELCEL Tel. (999) 960.7994