From:             [EMAIL PROTECTED]
Operating system: 
PHP version:      4.1.1
PHP Bug Type:     Documentation problem
Bug description:  unset and static variables

The example about static variables in the  manual page for "unset" is
broken : the output is actually 1 2 3 (not 1 1 1) there is no reset.

function foo() {
    static $a;
    $a++;
       echo "$a\n";

    unset($a);
}

foo();foo();foo()

>From the discussion of bugs 2015, 6810, and 13967 it seems it is clearly
an error in the doc.

Ivan
-- 
Edit bug report at http://bugs.php.net/?id=15570&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=15570&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=15570&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=15570&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=15570&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15570&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=15570&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=15570&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=15570&r=submittedtwice

Reply via email to