How does php deregister global variables?

Source: Internet
Author: User
How to deregister global variables in php recently looked at high-performance php and found that global variables should be deregistered after they are used up to release the memory. Baidu later found the unregister_globals (); & nbsp; function, but not too sure. Please give me some advice ~~ ------ Solution ------------------ how do you mostly log off global variables in the & nbsp; function & nbsp; glo php?
I recently looked at high-performance php and found that the global variables should be logged out after they are used up to release the memory.

Baidu later found the unregister_globals (); function, but not too sure.

Please give me some advice ~~
------ Solution --------------------
Most of you are in the global function, right? The function is automatically released after it runs... so you don't need to do anything.
I guess you are confused with $ GLOBAL.
------ Solution --------------------
Global only declares reference of global variables in the function.
Do not abuse it outside the function to avoid unnecessary misunderstanding.

Php releases all resources at the end of the program, including variables.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.