When and how are super global variables generated?

Source: Internet
Author: User
PHP Super Global variables, $_post, $_get, $_server, $_request, etc. ~ ~ ~
I want to know how these super global are generated, when generated, and how they work.
Who knows, tell me about it.

Reply content:

PHP Super Global variables, $_post, $_get, $_server, $_request, etc. ~ ~ ~
I want to know how these super global are generated, when generated, and how they work.
Who knows, tell me about it.

A significant portion of these variables is the one that Web server passes to PHP

In the case of Nginx, when a request comes over, Nginx first looks at how the configuration file is defined to pass some values to fastcgi (nginx configuration file fastcgi_params is for this purpose)

When Nginx initializes these variables, it passes them through the fastcgi port to PHP, and most of these variables can be seen in the $_server.

Of course, Nginx will also send the request sent by the client to the PHP fcgi to process, PHP itself will parse these requests to get $_get and $_post and other variables inside the value.

It's because PHP is doing things for us by default, so it's so easy to use PHP to do web programs-and because of that, it's causing the overflow of the PHP framework.

At first, please refer to http://www.slideshare.net/laruence/th ...

All the super global variables should is generated in the rinit process.

The so-called global is the variable that exists in any program's life cycle, PHP is born.
But these variables are only natural, their life cycle is no different from normal global, just a lot of system-level data will write them, and developers call directly.
It can be considered as a contract between the system and the developer.

This is a very good question, from the previous several answers to learn a lot, thank you. Thinking deeply about this problem can deepen the understanding of PHP.

The so-called super-estimate refers to these variables are more special.
Global variables should be used with caution

Is it possible to learn StackOverflow's community wiki function?

  • 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.