note 19069 deleted from function.unset by didou
| From: | didou@php.net | Date: | Tue, 19 Aug 2003 15:49:49 +0000 |
| Subject: | note 19069 deleted from function.unset by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54695@lists.php.net to get a copy of this message | ||
Note Submitter:
----
beware that the behavior of unset on static variables have changed. With php 4.1.1 the above example
actually output 1 2 3.
the static variable is unset after the call to unset but php "forgets" it has unsetted the
variable on the next call to foo :
function foo(){
static $a;
$a++;
echo "$a\n";
unset $a;
echo "$a\n";
}
foo();
foo();
foo();
will output
1
2
3
Ivan