unset Fuction
| From: | JohnT | Date: | Tue, 10 Feb 2004 03:54:05 +0000 |
| Subject: | unset Fuction | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177271@lists.php.net to get a copy of this message | ||
Hello,
mind explain a little bit further cause i'm confused and not sure if the
fuction really work or something
On 1st example.... using unset() in a function
/////////////// CODE /////////////////
function foo() {
static $a;
$a++;
echo "$a<BR>";
unset($a);
}
foo();
foo();
foo();
///////////////////////////////////////////////
******* RESULT ********
1
2
3
************************
On 2nd example.... removing unset() in a function, result is same as with
unset() on it. Should it be all 1's at this time?
/////////////// CODE /////////////////
function foo() {
static $a;
$a++;
echo "$a<BR>";
}
foo();
foo();
foo();
///////////////////////////////////////////////
******* RESULT ********
1
2
3
************************
Is it the code, function, or my php setup..any idea ???