Re: Static and Global at the same time!
| From: | Chris Boget | Date: | Fri, 10 Feb 2006 15:17:51 +0000 |
| Subject: | Re: Static and Global at the same time! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230210@lists.php.net to get a copy of this message | ||
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 it so that the static keyword is superfluous? Hmmm... Well, that is, of course, assuming that the function is the only place the variable is ever modified... thnx, Chris