-
What is register globals
I have read register globals will not be available in PHP6. Does it mean we'll not be able to use such type of code
PHP Code:
function a()
{
global $b;
$b = 10;
}
a();
echo $b;
OR
We'll be unable to receive get/post/cookie/session values using global?
To experiment this, I have disabled register_globals in phpi.ini and run the 1st code. But can easily get the value of $b. Now I am confused by the term register globals.
-
-
Thanks for the link. I have read it. But can you answer, will this change affect the keyword global as I used in the function?
-
No, register_globals has nothing to do with "global" keyword.
-
register_globals only affects the registration of request variables into the global scope.
Besides, using the keyword global is bad practice, so you should erase this one though~