Recent look at high-performance PHP, found that for global variables, after the use of the log off, to free memory.
Baidu later found Unregister_globals (); This function, but is not too sure.
Please the great God pointing twos ~ ~
Reply to discussion (solution)
Who is so bored that you do this weird thing?
Is this weird?
I understand it wrong. Just use unset () to drop the global variable!!
You're probably in the function of global, right? The function is automatically released when it runs out ... So you don't have to do anything.
I'm guessing you're messing with $global.
You're probably in the function of global, right? The function is automatically released when it runs out ... So you don't have to do anything.
I'm guessing you're messing with $global.
The code is like this
Global $db;
Global $user;
Unset ($db, $user);
If there is no unset, $db, $user will be automatically released at the end of the function?
Global is only used to declare a reference in a function
Please do not misuse outside the function to avoid unnecessary misunderstanding.
PHP will release all resources at the end of the program, including variables
Unset () It's okay.
Global is only used to declare a reference in a function
Please do not misuse outside the function to avoid unnecessary misunderstanding.
PHP will release all resources at the end of the program, including variables
Oh, thank you.