Hi group,
Why won't $new_var be unset in the following function?
Am i missing out something?
Greetings Frizzle.
*************** *************** *******
function DoThis( $state, $fst = 1, $scnd = 2)
{
if( $state === 0 )
{
global $new_var;
unset($new_var) ;
}
else
{
global $new_var;
return $new_var = $fst + $scnd;
};
};
echo DoThis( 1, 4, 8);
echo DoThis( 0 );
echo 'new_var= '.$new_var;
Why won't $new_var be unset in the following function?
Am i missing out something?
Greetings Frizzle.
*************** *************** *******
function DoThis( $state, $fst = 1, $scnd = 2)
{
if( $state === 0 )
{
global $new_var;
unset($new_var) ;
}
else
{
global $new_var;
return $new_var = $fst + $scnd;
};
};
echo DoThis( 1, 4, 8);
echo DoThis( 0 );
echo 'new_var= '.$new_var;
Comment