Re: unset Fuction
| From: | Paul Furman | Date: | Tue, 10 Feb 2004 12:54:39 +0000 |
| Subject: | Re: unset Fuction | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177274@lists.php.net to get a copy of this message | ||
Johnt wrote:
function foo() {
static $a;
$a++;
echo "$a<BR>";
unset($a);
}
foo();
foo();
foo();
///////////////////////////////////////////////
******* RESULT ********
1
2
3
************************
Should it be all 1's at this time?
Is it the code, function, or my php setup..any idea ???
I thought the purpose of unset was to remove positions inside arrays. Not sure if it was intended for simple variables. I've used it for checking isset like this:
unset ($_POST[...
isset ($_POST[...