TitanKing
October 9th, 2008, 09:56 AM
Very odd problem, I realized something odd was going on when I needed to create a simple function with global variables inside function, according to the manual, this should print the number 3;
$a = 1;
$b = 2;
function Sum()
{
global $a, $b;
$b = $a + $b;
}
Sum();
echo $b;
However, mine prints the original $b which is 2, it seems it is ignoring global.
Is this a bug?
$a = 1;
$b = 2;
function Sum()
{
global $a, $b;
$b = $a + $b;
}
Sum();
echo $b;
However, mine prints the original $b which is 2, it seems it is ignoring global.
Is this a bug?