Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content: the first time this problem occurs. A little curious. How did the subject discover this problem?
Let me explain my understanding.
First, we need to clarify"
Assignment.
When $ a = 1;, it does not mean to add data whose name is $ a and whose value is 1.
When $ B = & $ a;, it doesn't mean to point $ B to $ a or vice versa.
The image of this process is as follows:
$a = 1;
Read more php manuals, many examples
PHP: variable range
PHP: References
PHP: reference transfer
PHP: Reference
Variable range
The scope of a variable is the context defined by it (that is, its effective range ). Most PHP variables have only one separate range. This separate range span also contains the files introduced by include and require. For example:
Global $ a; a new pointer pointing to the same address as external $ a $ GLOBALS ['A'] = & $ static_a; will point the external $ a pointer to the content of $ static_a, discard the original pointing