Mantis - Quercus
Viewing Issue Advanced Details
2259 minor always 12-15-07 13:30 05-12-08 16:47
koreth  
ferg  
normal  
closed 3.1.4  
fixed  
none    
none 3.2.0  
0002259: Can't unset a global from inside a function
<?php
$TESTVAR = 'abc';

function rm1() {
        unset($GLOBALS['TESTVAR']);
}

function rm2() {
        global $TESTVAR;
        unset($TESTVAR);
}

rm1();
print $TESTVAR . "\n";
rm2();
print $TESTVAR . "\n";
unset($TESTVAR);
print $TESTVAR . "\n";


Vanilla PHP prints three blank lines. Quercus (both interpreted and compiled mode) prints "abc" twice, then a blank line -- the unset() calls inside the functions aren't working, but the global-scope one is.

Notes
(0003054)
ferg   
05-12-08 16:47   
php/023b, php/323b